Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NetCodeGroup.cs
- FontConverter.cs
- PaintValueEventArgs.cs
- InfoCardSymmetricAlgorithm.cs
- InvokeGenerator.cs
- TemplateInstanceAttribute.cs
- SpecularMaterial.cs
- EventLogPermissionEntry.cs
- ParamArrayAttribute.cs
- SqlConnectionManager.cs
- HttpHandlerActionCollection.cs
- UshortList2.cs
- HtmlInputReset.cs
- QueryCacheEntry.cs
- UserControl.cs
- Object.cs
- XmlSchemaGroupRef.cs
- CommandEventArgs.cs
- CacheAxisQuery.cs
- WindowsEditBoxRange.cs
- ServiceDebugBehavior.cs
- RequestTimeoutManager.cs
- ManifestSignatureInformation.cs
- State.cs
- ValidationHelper.cs
- QuaternionAnimation.cs
- NavigatorOutput.cs
- WebPartEditVerb.cs
- HtmlButton.cs
- ConvertersCollection.cs
- MessageQueueTransaction.cs
- SqlColumnizer.cs
- FontStretchConverter.cs
- PerformanceCounterCategory.cs
- DocumentSequenceHighlightLayer.cs
- SmiEventSink_Default.cs
- BrowsableAttribute.cs
- QuadraticBezierSegment.cs
- SubtreeProcessor.cs
- SchemaAttDef.cs
- XmlDataImplementation.cs
- ExecutionEngineException.cs
- SignedXml.cs
- AttributeCollection.cs
- PrtCap_Builder.cs
- BaseServiceProvider.cs
- ConfigsHelper.cs
- ButtonAutomationPeer.cs
- SqlBooleanMismatchVisitor.cs
- WebPartEditorApplyVerb.cs
- PropertyToken.cs
- ValueUtilsSmi.cs
- EllipseGeometry.cs
- QilInvoke.cs
- PageBuildProvider.cs
- PagesSection.cs
- HttpCacheVary.cs
- ModelFactory.cs
- DiscardableAttribute.cs
- XmlElementAttributes.cs
- querybuilder.cs
- XmlHelper.cs
- TreeViewImageKeyConverter.cs
- ContextProperty.cs
- ModulesEntry.cs
- ImageMap.cs
- FloaterBaseParagraph.cs
- Duration.cs
- BuildProviderCollection.cs
- _ConnectStream.cs
- followingsibling.cs
- AliasedExpr.cs
- Point4D.cs
- ThreadPool.cs
- PopupRoot.cs
- SiteMapPathDesigner.cs
- AuthStoreRoleProvider.cs
- RowType.cs
- TextBounds.cs
- TemplateNameScope.cs
- PagePropertiesChangingEventArgs.cs
- ContextInformation.cs
- BeginEvent.cs
- Scalars.cs
- NullReferenceException.cs
- ServiceHandle.cs
- RuleRefElement.cs
- CompatibleComparer.cs
- MetaChildrenColumn.cs
- BufferedStream.cs
- InstanceView.cs
- ValidationRuleCollection.cs
- XXXOnTypeBuilderInstantiation.cs
- JapaneseLunisolarCalendar.cs
- FormsIdentity.cs
- DrawingContextWalker.cs
- ExpressionVisitorHelpers.cs
- SecondaryIndexDefinition.cs
- ElementNotAvailableException.cs
- PrefixHandle.cs