Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContentHostHelper.cs
- cookiecontainer.cs
- BindingMemberInfo.cs
- Convert.cs
- MultiSelector.cs
- RadioButtonFlatAdapter.cs
- MimeParameterWriter.cs
- ToolStripDropTargetManager.cs
- PropertyChangingEventArgs.cs
- FileNotFoundException.cs
- PrintPreviewControl.cs
- SafeCryptHandles.cs
- ContentAlignmentEditor.cs
- AutomationPropertyInfo.cs
- GetPageNumberCompletedEventArgs.cs
- RefreshPropertiesAttribute.cs
- ReadOnlyHierarchicalDataSource.cs
- Module.cs
- OuterGlowBitmapEffect.cs
- CardSpacePolicyElement.cs
- DataGridViewCheckBoxCell.cs
- DataGridTable.cs
- NameTable.cs
- BrowserCapabilitiesCompiler.cs
- AppDomainFactory.cs
- TableRowCollection.cs
- PeerObject.cs
- BinaryMethodMessage.cs
- TraceInternal.cs
- StoreItemCollection.cs
- XPathBinder.cs
- ThreadAbortException.cs
- SafeFileMapViewHandle.cs
- SimpleTextLine.cs
- safelink.cs
- GatewayIPAddressInformationCollection.cs
- FlowPanelDesigner.cs
- RoleServiceManager.cs
- HttpValueCollection.cs
- ProtocolImporter.cs
- RegisteredArrayDeclaration.cs
- translator.cs
- contentDescriptor.cs
- NativeMethods.cs
- SignatureDescription.cs
- ConstantSlot.cs
- WindowsRichEditRange.cs
- UseAttributeSetsAction.cs
- XmlTextWriter.cs
- RegexTypeEditor.cs
- CommonObjectSecurity.cs
- RequestCachingSection.cs
- HtmlWindowCollection.cs
- SafeRightsManagementQueryHandle.cs
- IISUnsafeMethods.cs
- IconConverter.cs
- XmlName.cs
- MarshalDirectiveException.cs
- ServiceOperation.cs
- SizeAnimationUsingKeyFrames.cs
- ProgramNode.cs
- EntityProviderServices.cs
- SoapAttributes.cs
- XmlSchemaException.cs
- SafeNativeMethods.cs
- FixedSOMTable.cs
- WebResourceAttribute.cs
- SignedInfo.cs
- HttpRuntime.cs
- StorageMappingItemCollection.cs
- TabletDeviceInfo.cs
- TraceProvider.cs
- RadioButtonFlatAdapter.cs
- SolidColorBrush.cs
- ColorInterpolationModeValidation.cs
- TypeExtensionConverter.cs
- AnnotationStore.cs
- ImageListImage.cs
- EdmComplexPropertyAttribute.cs
- TrackingProfileCache.cs
- DocumentViewerHelper.cs
- NonParentingControl.cs
- TreeViewImageIndexConverter.cs
- _AutoWebProxyScriptEngine.cs
- XPathDocumentNavigator.cs
- ISessionStateStore.cs
- PriorityRange.cs
- EdmFunctions.cs
- EntityTypeEmitter.cs
- DES.cs
- ResolveNameEventArgs.cs
- RootBrowserWindowProxy.cs
- DictionaryManager.cs
- CatalogPartCollection.cs
- Evaluator.cs
- HttpClientCertificate.cs
- StylusShape.cs
- StructuredProperty.cs
- PasswordRecovery.cs
- EntityContainerAssociationSetEnd.cs