Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / Common / HandlerBase.cs / 1 / HandlerBase.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Common { using System; using System.Collections; using System.Configuration; using System.Diagnostics; using System.Globalization; using System.Xml; internal static class HandlerBase { static internal void CheckForChildNodes(XmlNode node) { if (node.HasChildNodes) { throw ADP.ConfigBaseNoChildNodes(node.FirstChild); } } static private void CheckForNonElement(XmlNode node) { if (XmlNodeType.Element != node.NodeType) { throw ADP.ConfigBaseElementsOnly(node); } } static internal void CheckForUnrecognizedAttributes(XmlNode node) { if (0 != node.Attributes.Count) { throw ADP.ConfigUnrecognizedAttributes(node); } } // skip whitespace and comments, throws if non-element static internal bool IsIgnorableAlsoCheckForNonElement(XmlNode node) { if ((XmlNodeType.Comment == node.NodeType) || (XmlNodeType.Whitespace == node.NodeType)) { return true; } CheckForNonElement(node); return false; } static internal string RemoveAttribute(XmlNode node, string name, bool required, bool allowEmpty) { XmlNode attribute = node.Attributes.RemoveNamedItem(name); if (null == attribute) { if (required) { throw ADP.ConfigRequiredAttributeMissing(name, node); } return null; } string value = attribute.Value; if (!allowEmpty && (0 == value.Length)) { throw ADP.ConfigRequiredAttributeEmpty(name, node); } return value; } static internal DataSet CloneParent(DataSet parentConfig, bool insenstive) { if (null == parentConfig) { parentConfig = new DataSet(DbProviderFactoriesConfigurationHandler.sectionName); parentConfig.CaseSensitive = !insenstive; parentConfig.Locale = CultureInfo.InvariantCulture; } else { parentConfig = parentConfig.Copy(); } return parentConfig; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Common { using System; using System.Collections; using System.Configuration; using System.Diagnostics; using System.Globalization; using System.Xml; internal static class HandlerBase { static internal void CheckForChildNodes(XmlNode node) { if (node.HasChildNodes) { throw ADP.ConfigBaseNoChildNodes(node.FirstChild); } } static private void CheckForNonElement(XmlNode node) { if (XmlNodeType.Element != node.NodeType) { throw ADP.ConfigBaseElementsOnly(node); } } static internal void CheckForUnrecognizedAttributes(XmlNode node) { if (0 != node.Attributes.Count) { throw ADP.ConfigUnrecognizedAttributes(node); } } // skip whitespace and comments, throws if non-element static internal bool IsIgnorableAlsoCheckForNonElement(XmlNode node) { if ((XmlNodeType.Comment == node.NodeType) || (XmlNodeType.Whitespace == node.NodeType)) { return true; } CheckForNonElement(node); return false; } static internal string RemoveAttribute(XmlNode node, string name, bool required, bool allowEmpty) { XmlNode attribute = node.Attributes.RemoveNamedItem(name); if (null == attribute) { if (required) { throw ADP.ConfigRequiredAttributeMissing(name, node); } return null; } string value = attribute.Value; if (!allowEmpty && (0 == value.Length)) { throw ADP.ConfigRequiredAttributeEmpty(name, node); } return value; } static internal DataSet CloneParent(DataSet parentConfig, bool insenstive) { if (null == parentConfig) { parentConfig = new DataSet(DbProviderFactoriesConfigurationHandler.sectionName); parentConfig.CaseSensitive = !insenstive; parentConfig.Locale = CultureInfo.InvariantCulture; } else { parentConfig = parentConfig.Copy(); } return parentConfig; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SmiRequestExecutor.cs
- KnownAssemblyEntry.cs
- RecordManager.cs
- XmlNamedNodeMap.cs
- TextViewBase.cs
- WindowsIPAddress.cs
- CompoundFileDeflateTransform.cs
- ObjectDisposedException.cs
- MailAddress.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- BufferedMessageWriter.cs
- StylusPlugInCollection.cs
- DataIdProcessor.cs
- SamlConstants.cs
- DefaultTraceListener.cs
- IfJoinedCondition.cs
- XpsFilter.cs
- AttributedMetaModel.cs
- FixedStringLookup.cs
- SmtpReplyReader.cs
- Match.cs
- ContainerVisual.cs
- XsltContext.cs
- ComboBoxHelper.cs
- control.ime.cs
- DoubleAnimation.cs
- ResXResourceWriter.cs
- Attributes.cs
- ObjectDataSourceMethodEventArgs.cs
- CodeCompileUnit.cs
- SegmentTree.cs
- ImageButton.cs
- OdbcTransaction.cs
- ObjectStateEntryDbDataRecord.cs
- CollectionContainer.cs
- SapiRecognizer.cs
- RoleBoolean.cs
- FilterableData.cs
- MultiSelectRootGridEntry.cs
- Attributes.cs
- MethodBuilder.cs
- Models.cs
- httpapplicationstate.cs
- XmlEntity.cs
- DataError.cs
- WebPartsPersonalizationAuthorization.cs
- CodeDelegateCreateExpression.cs
- LookupBindingPropertiesAttribute.cs
- Timer.cs
- SerialPort.cs
- ProfileService.cs
- SystemWebSectionGroup.cs
- MouseOverProperty.cs
- SqlCharStream.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- BaseTemplatedMobileComponentEditor.cs
- DataBindingList.cs
- activationcontext.cs
- SplayTreeNode.cs
- ContextInformation.cs
- OperationExecutionFault.cs
- ContractUtils.cs
- AsymmetricKeyExchangeDeformatter.cs
- AsymmetricCryptoHandle.cs
- CfgArc.cs
- SpellCheck.cs
- NullableLongAverageAggregationOperator.cs
- StylusCaptureWithinProperty.cs
- PrintDialog.cs
- BulletedList.cs
- WrapPanel.cs
- UrlMappingCollection.cs
- XmlDataCollection.cs
- TextChangedEventArgs.cs
- AppSettingsReader.cs
- EncoderExceptionFallback.cs
- ApplicationBuildProvider.cs
- ReachNamespaceInfo.cs
- GotoExpression.cs
- AdornerLayer.cs
- ColumnBinding.cs
- QueryableDataSource.cs
- BitmapEffectState.cs
- ImmutableObjectAttribute.cs
- AutomationInteropProvider.cs
- CodeTypeReferenceSerializer.cs
- DataServiceRequestOfT.cs
- Padding.cs
- NeutralResourcesLanguageAttribute.cs
- RegistrySecurity.cs
- XamlHostingSection.cs
- ImageMapEventArgs.cs
- ImageAutomationPeer.cs
- ListenUriMode.cs
- BaseAsyncResult.cs
- BufferedGraphicsContext.cs
- HashHelper.cs
- Parameter.cs
- EmptyReadOnlyDictionaryInternal.cs
- AbandonedMutexException.cs