Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Common / HandlerBase.cs / 1305376 / 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
- LinqDataSourceSelectEventArgs.cs
- BulletedListEventArgs.cs
- SessionIDManager.cs
- DataRelation.cs
- MediaSystem.cs
- ClientOptions.cs
- DataGridRow.cs
- FileSecurity.cs
- NamedPipeTransportElement.cs
- ConfigurationElementProperty.cs
- TagMapCollection.cs
- UmAlQuraCalendar.cs
- ExceptionValidationRule.cs
- StorageEntityContainerMapping.cs
- DSASignatureFormatter.cs
- DynamicILGenerator.cs
- PlatformNotSupportedException.cs
- GenericUriParser.cs
- FileRecordSequenceHelper.cs
- ProfileParameter.cs
- ExtentKey.cs
- VisualBasicImportReference.cs
- OdbcDataReader.cs
- VersionPair.cs
- CodeCommentStatementCollection.cs
- FolderLevelBuildProviderCollection.cs
- HtmlElementCollection.cs
- HyperLinkStyle.cs
- BrowserInteropHelper.cs
- StartUpEventArgs.cs
- ellipse.cs
- WindowsRebar.cs
- StorageFunctionMapping.cs
- PolicyReader.cs
- SolidColorBrush.cs
- PowerEase.cs
- XsdDateTime.cs
- SrgsDocumentParser.cs
- ProviderManager.cs
- WebPartAddingEventArgs.cs
- BoolExpression.cs
- LogicalMethodInfo.cs
- QilList.cs
- ButtonBase.cs
- ContentOperations.cs
- CompositeCollectionView.cs
- ComponentEditorForm.cs
- BorderGapMaskConverter.cs
- SingleObjectCollection.cs
- DesignOnlyAttribute.cs
- DelegateBodyWriter.cs
- WebBrowserSiteBase.cs
- XamlSerializerUtil.cs
- DBCommandBuilder.cs
- EllipticalNodeOperations.cs
- SoapServerMessage.cs
- FixedSchema.cs
- RelationalExpressions.cs
- CodeGenerator.cs
- SafeNativeMethods.cs
- DefaultTextStoreTextComposition.cs
- ReadingWritingEntityEventArgs.cs
- SingleObjectCollection.cs
- TargetConverter.cs
- hebrewshape.cs
- CommonDialog.cs
- DeviceContext.cs
- IPCCacheManager.cs
- PropertyMappingExceptionEventArgs.cs
- PeerCollaboration.cs
- GraphicsState.cs
- CapabilitiesRule.cs
- SettingsBase.cs
- Panel.cs
- ObjectDataSource.cs
- ExeConfigurationFileMap.cs
- HtmlElementEventArgs.cs
- DataSetMappper.cs
- FormViewDeletedEventArgs.cs
- Merger.cs
- GuidelineSet.cs
- _NestedSingleAsyncResult.cs
- MailMessageEventArgs.cs
- SimpleMailWebEventProvider.cs
- Type.cs
- SplayTreeNode.cs
- FileDialog.cs
- LoginUtil.cs
- XpsSerializationException.cs
- HotSpotCollectionEditor.cs
- ReachPageContentSerializer.cs
- DirectionalLight.cs
- TextEditorSelection.cs
- ProxyManager.cs
- ConnectionPoint.cs
- SqlUserDefinedAggregateAttribute.cs
- BoundingRectTracker.cs
- TdsParserSafeHandles.cs
- TextViewElement.cs
- AutomationPatternInfo.cs