Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- EdmItemCollection.cs
- OverloadGroupAttribute.cs
- XsdCachingReader.cs
- DbParameterCollectionHelper.cs
- ComponentDispatcherThread.cs
- ClientProxyGenerator.cs
- ScriptIgnoreAttribute.cs
- Pkcs9Attribute.cs
- XMLSyntaxException.cs
- HijriCalendar.cs
- GridView.cs
- BamlResourceDeserializer.cs
- EnumerableRowCollection.cs
- DataGridCaption.cs
- ClassHandlersStore.cs
- CellQuery.cs
- FieldNameLookup.cs
- XmlSchemaObjectCollection.cs
- HttpFileCollection.cs
- DateTimeUtil.cs
- DBConnectionString.cs
- EllipseGeometry.cs
- FunctionDescription.cs
- IriParsingElement.cs
- Attribute.cs
- TextSelection.cs
- _FtpControlStream.cs
- IdentifierService.cs
- WindowsAltTab.cs
- FlowDocumentScrollViewer.cs
- BooleanFunctions.cs
- HttpResponseWrapper.cs
- ProvideValueServiceProvider.cs
- ConfigurationPropertyCollection.cs
- InternalControlCollection.cs
- WebPartMinimizeVerb.cs
- FlowDecision.cs
- Matrix3DValueSerializer.cs
- DBCommand.cs
- CommonXSendMessage.cs
- Profiler.cs
- ProgressBarRenderer.cs
- WebPartManagerInternals.cs
- SocketAddress.cs
- DBConnection.cs
- ItemChangedEventArgs.cs
- DecoderReplacementFallback.cs
- BufferedGraphics.cs
- MessageSmuggler.cs
- ZipPackagePart.cs
- ZipIORawDataFileBlock.cs
- ToolboxItemFilterAttribute.cs
- EastAsianLunisolarCalendar.cs
- ProgressBarHighlightConverter.cs
- DataServiceStreamProviderWrapper.cs
- GenericEnumConverter.cs
- PermissionSetEnumerator.cs
- ListenUriMode.cs
- Evidence.cs
- TypeUnloadedException.cs
- XamlPoint3DCollectionSerializer.cs
- PerformanceCounterPermission.cs
- CommonRemoteMemoryBlock.cs
- ItemMap.cs
- SecurityPolicySection.cs
- ProjectionNode.cs
- SynchronizedInputAdaptor.cs
- QueryStack.cs
- SchemaAttDef.cs
- ClientTarget.cs
- TextParagraph.cs
- VisualStyleElement.cs
- MetabaseReader.cs
- EventBuilder.cs
- StringOutput.cs
- SocketElement.cs
- InertiaExpansionBehavior.cs
- Bidi.cs
- ConfigurationElementCollection.cs
- OneOfElement.cs
- FixedSOMSemanticBox.cs
- MarkupProperty.cs
- FileSecurity.cs
- DragDeltaEventArgs.cs
- MessageSecurityProtocol.cs
- KeySpline.cs
- ISAPIRuntime.cs
- FontNamesConverter.cs
- PropertyDescriptorGridEntry.cs
- MouseCaptureWithinProperty.cs
- EntityDataReader.cs
- CalendarDateChangedEventArgs.cs
- DataGridViewCellEventArgs.cs
- BinHexEncoder.cs
- EventBindingService.cs
- DesignerAutoFormatStyle.cs
- DeviceSpecificDesigner.cs
- SecUtil.cs
- HyperLinkDesigner.cs
- ColumnClickEvent.cs