Code:
/ DotNET / DotNET / 8.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
- ReadOnlyPermissionSet.cs
- CngUIPolicy.cs
- Logging.cs
- RelationshipEntry.cs
- CompositeCollection.cs
- ToolboxBitmapAttribute.cs
- ToolStripItemImageRenderEventArgs.cs
- OfTypeExpression.cs
- ScriptComponentDescriptor.cs
- CryptoApi.cs
- HostExecutionContextManager.cs
- ListViewItemEventArgs.cs
- ILGenerator.cs
- IPGlobalProperties.cs
- Filter.cs
- Rights.cs
- DateTimeParse.cs
- ByteKeyFrameCollection.cs
- HttpListenerRequest.cs
- ReachVisualSerializer.cs
- SecurityKeyIdentifierClause.cs
- SqlProcedureAttribute.cs
- ConnectionProviderAttribute.cs
- SqlSupersetValidator.cs
- UnsafeNativeMethods.cs
- XmlException.cs
- AuthenticationSection.cs
- ChangeProcessor.cs
- EDesignUtil.cs
- EntityFunctions.cs
- CompressionTransform.cs
- DrawingDrawingContext.cs
- WorkflowTransactionOptions.cs
- AssertSection.cs
- MetaType.cs
- _NestedSingleAsyncResult.cs
- SerTrace.cs
- AvTrace.cs
- EntityCommandDefinition.cs
- XmlILOptimizerVisitor.cs
- DependencyPropertyChangedEventArgs.cs
- LoaderAllocator.cs
- Attributes.cs
- ComplusTypeValidator.cs
- OciHandle.cs
- NotifyParentPropertyAttribute.cs
- BinaryMessageFormatter.cs
- Canvas.cs
- EdgeModeValidation.cs
- CodeDesigner.cs
- ImageAttributes.cs
- NativeCompoundFileAPIs.cs
- SpnEndpointIdentityExtension.cs
- CredentialCache.cs
- HwndAppCommandInputProvider.cs
- ConsumerConnectionPoint.cs
- DataViewSetting.cs
- nulltextcontainer.cs
- NonceToken.cs
- PermissionSetEnumerator.cs
- RSAOAEPKeyExchangeFormatter.cs
- ByteStreamMessageEncodingElement.cs
- AppDomainProtocolHandler.cs
- Stack.cs
- TemplatedEditableDesignerRegion.cs
- DesignerSerializationOptionsAttribute.cs
- ViewValidator.cs
- Suspend.cs
- SmiEventSink.cs
- HtmlShimManager.cs
- TreeView.cs
- EventDriven.cs
- KeyProperty.cs
- ModulesEntry.cs
- XmlNodeChangedEventArgs.cs
- IntSecurity.cs
- SerializableAttribute.cs
- DesigntimeLicenseContextSerializer.cs
- SafeUserTokenHandle.cs
- CoTaskMemHandle.cs
- AutomationIdentifierGuids.cs
- AtomServiceDocumentSerializer.cs
- IndexedString.cs
- TimerEventSubscription.cs
- CompilationRelaxations.cs
- CodeConstructor.cs
- MetaTable.cs
- XmlSchemaComplexContentRestriction.cs
- DashStyles.cs
- ButtonBase.cs
- WebPartManagerInternals.cs
- StringKeyFrameCollection.cs
- XmlSerializerSection.cs
- FilterElement.cs
- TemplatedAdorner.cs
- PlatformCulture.cs
- WpfKnownTypeInvoker.cs
- ListViewItem.cs
- CheckPair.cs
- MailBnfHelper.cs