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
- ComplusTypeValidator.cs
- safelink.cs
- KeyValueConfigurationCollection.cs
- EntitySqlQueryState.cs
- RC2.cs
- XmlSchemaComplexContent.cs
- X509SecurityTokenProvider.cs
- DrawListViewItemEventArgs.cs
- SessionSwitchEventArgs.cs
- _ConnectStream.cs
- ArgIterator.cs
- XPathSelectionIterator.cs
- StructuralComparisons.cs
- BamlResourceSerializer.cs
- TabControlCancelEvent.cs
- ApplicationServiceHelper.cs
- filewebresponse.cs
- CodeDomDesignerLoader.cs
- BuilderPropertyEntry.cs
- ApplicationServicesHostFactory.cs
- TogglePattern.cs
- ExtenderControl.cs
- HttpSessionStateWrapper.cs
- CodeIndexerExpression.cs
- PriorityBindingExpression.cs
- SystemResources.cs
- EncoderExceptionFallback.cs
- DesignerHelpers.cs
- DataErrorValidationRule.cs
- VectorCollectionValueSerializer.cs
- ExpressionLexer.cs
- DataGridHeaderBorder.cs
- AccessibilityHelperForXpWin2k3.cs
- AttributeProviderAttribute.cs
- LifetimeServices.cs
- DnsCache.cs
- DropShadowBitmapEffect.cs
- TabControlToolboxItem.cs
- DiscoveryService.cs
- SoapServerMethod.cs
- XmlDocumentSerializer.cs
- Control.cs
- UsernameTokenFactoryCredential.cs
- Pair.cs
- BamlRecordReader.cs
- PluralizationServiceUtil.cs
- DuplicateWaitObjectException.cs
- AxisAngleRotation3D.cs
- LicFileLicenseProvider.cs
- InstanceDataCollection.cs
- SettingsSavedEventArgs.cs
- XamlStream.cs
- TreePrinter.cs
- BitArray.cs
- Resources.Designer.cs
- DataGridViewColumnConverter.cs
- TabControlCancelEvent.cs
- LostFocusEventManager.cs
- ExpressionBuilder.cs
- ADMembershipProvider.cs
- MultiAsyncResult.cs
- PageCodeDomTreeGenerator.cs
- ActivityMarkupSerializer.cs
- GetIndexBinder.cs
- WebMessageBodyStyleHelper.cs
- DoubleUtil.cs
- XmlEncodedRawTextWriter.cs
- SetIterators.cs
- RegexCompilationInfo.cs
- PerformanceCountersElement.cs
- cookiecollection.cs
- ItemsControl.cs
- HMACSHA384.cs
- DataGridItemCollection.cs
- TypeToStringValueConverter.cs
- GenericEnumConverter.cs
- SoapSchemaImporter.cs
- ValueExpressions.cs
- WsdlExporter.cs
- FaultPropagationQuery.cs
- DefaultProxySection.cs
- GenericArgumentsUpdater.cs
- WebZone.cs
- AddInServer.cs
- Configuration.cs
- OracleMonthSpan.cs
- DataSourceHelper.cs
- TempFiles.cs
- SelectionPattern.cs
- ServiceManager.cs
- MultilineStringConverter.cs
- ConvertEvent.cs
- ViewKeyConstraint.cs
- EventRoute.cs
- RSATokenProvider.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- StaticResourceExtension.cs
- NotCondition.cs
- ThreadStaticAttribute.cs
- DataGridViewAccessibleObject.cs