Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SoapReflector.cs
- IndexOutOfRangeException.cs
- Rotation3DAnimation.cs
- GifBitmapDecoder.cs
- EnvironmentPermission.cs
- CounterCreationDataCollection.cs
- ViewStateAttachedPropertyFeature.cs
- CurrencyWrapper.cs
- Style.cs
- HyperLinkColumn.cs
- ToolStripArrowRenderEventArgs.cs
- AttributeEmitter.cs
- PeoplePickerWrapper.cs
- ArraySet.cs
- NestedContainer.cs
- WSHttpSecurityElement.cs
- UDPClient.cs
- ReadOnlyAttribute.cs
- UrlMapping.cs
- LeafCellTreeNode.cs
- DataGridColumn.cs
- EntitySetBase.cs
- DesignerDataStoredProcedure.cs
- TreeNode.cs
- PropertyTabAttribute.cs
- DtdParser.cs
- TransformDescriptor.cs
- SHA256.cs
- LinearGradientBrush.cs
- ExpressionPrefixAttribute.cs
- OwnerDrawPropertyBag.cs
- PropertyDescriptorComparer.cs
- BlurBitmapEffect.cs
- SliderAutomationPeer.cs
- PreviewKeyDownEventArgs.cs
- DataErrorValidationRule.cs
- SqlCachedBuffer.cs
- ExtendedProperty.cs
- SizeValueSerializer.cs
- CreateUserWizardStep.cs
- CounterCreationData.cs
- HMACSHA1.cs
- TypeReference.cs
- FloaterParagraph.cs
- RelationalExpressions.cs
- IRCollection.cs
- DocumentSignatureManager.cs
- Region.cs
- ExpressionEditorAttribute.cs
- HtmlInputHidden.cs
- RC2.cs
- unitconverter.cs
- SurrogateSelector.cs
- ControlParameter.cs
- OneOfConst.cs
- StreamFormatter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- Stroke2.cs
- SQLDateTime.cs
- TimeZoneInfo.cs
- OTFRasterizer.cs
- SelectorItemAutomationPeer.cs
- CaseInsensitiveOrdinalStringComparer.cs
- DateTimeValueSerializer.cs
- DefaultAsyncDataDispatcher.cs
- Crc32.cs
- SerializerDescriptor.cs
- XmlRootAttribute.cs
- MeshGeometry3D.cs
- AtomEntry.cs
- CannotUnloadAppDomainException.cs
- SqlRowUpdatedEvent.cs
- TypeForwardedFromAttribute.cs
- ObjectStateManagerMetadata.cs
- SqlFlattener.cs
- HostingEnvironmentException.cs
- listitem.cs
- OutputCacheModule.cs
- XPathSelfQuery.cs
- SystemShuttingDownException.cs
- MetadataItemEmitter.cs
- CodeAttributeArgument.cs
- GridItemProviderWrapper.cs
- Operand.cs
- XmlDataSourceNodeDescriptor.cs
- ModulesEntry.cs
- AddInController.cs
- SecUtil.cs
- SystemFonts.cs
- SqlInfoMessageEvent.cs
- AQNBuilder.cs
- ElementHostAutomationPeer.cs
- LeafCellTreeNode.cs
- PropertyOrder.cs
- RangeValidator.cs
- DBConnectionString.cs
- MobileTextWriter.cs
- DurableOperationContext.cs
- ThumbAutomationPeer.cs
- wgx_exports.cs