Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- TableHeaderCell.cs
- RangeContentEnumerator.cs
- MiniCustomAttributeInfo.cs
- BoundPropertyEntry.cs
- Content.cs
- FillBehavior.cs
- PrintingPermission.cs
- DetailsViewPagerRow.cs
- PersistenceTypeAttribute.cs
- HttpVersion.cs
- Model3DGroup.cs
- WindowsSolidBrush.cs
- ObjectPersistData.cs
- WebPartDeleteVerb.cs
- SecurityCredentialsManager.cs
- FileDialogPermission.cs
- ClassicBorderDecorator.cs
- HandlerBase.cs
- FacetDescription.cs
- XmlMapping.cs
- AsymmetricAlgorithm.cs
- FlowLayoutSettings.cs
- PassportAuthenticationEventArgs.cs
- ScrollBarRenderer.cs
- DocobjHost.cs
- WaitForChangedResult.cs
- ExpressionEditorSheet.cs
- XmlIncludeAttribute.cs
- NameNode.cs
- FixedNode.cs
- ReflectPropertyDescriptor.cs
- PeerChannelFactory.cs
- XslCompiledTransform.cs
- ClientSession.cs
- _ConnectOverlappedAsyncResult.cs
- DataGridCommandEventArgs.cs
- FormatterConverter.cs
- PackageDigitalSignatureManager.cs
- HttpListenerResponse.cs
- OpenFileDialog.cs
- XmlC14NWriter.cs
- TCPClient.cs
- TextDecorationLocationValidation.cs
- GenericTextProperties.cs
- GridViewColumnHeader.cs
- TableAutomationPeer.cs
- Executor.cs
- Point3DConverter.cs
- StorageComplexTypeMapping.cs
- FormatException.cs
- DeferredElementTreeState.cs
- WebPartEditVerb.cs
- BitSet.cs
- CacheDependency.cs
- ObjectStateManagerMetadata.cs
- BrushConverter.cs
- ProfileGroupSettings.cs
- BindingContext.cs
- Identity.cs
- CommandBinding.cs
- WebResourceAttribute.cs
- CheckPair.cs
- QueryHandler.cs
- Ray3DHitTestResult.cs
- AddressHeaderCollection.cs
- SelectionItemProviderWrapper.cs
- AssemblyCache.cs
- ProjectedSlot.cs
- QilInvokeEarlyBound.cs
- WebPartMenuStyle.cs
- ExpressionBindings.cs
- TargetConverter.cs
- ControllableStoryboardAction.cs
- ListInitExpression.cs
- XMLUtil.cs
- DataGridView.cs
- WebPart.cs
- XamlReaderHelper.cs
- ObjectHandle.cs
- ProcessMonitor.cs
- Package.cs
- ColumnHeader.cs
- DEREncoding.cs
- HwndStylusInputProvider.cs
- MsmqIntegrationInputChannel.cs
- DesignerProperties.cs
- BaseTreeIterator.cs
- XmlExpressionDumper.cs
- ManualResetEvent.cs
- PageRequestManager.cs
- RequestSecurityTokenForGetBrowserToken.cs
- Serializer.cs
- TextProperties.cs
- InvalidProgramException.cs
- BitStream.cs
- ActivityMarkupSerializer.cs
- AuthenticationSchemesHelper.cs
- CodeTypeOfExpression.cs
- SqlFactory.cs
- GiveFeedbackEvent.cs