Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- InvokerUtil.cs
- NetSectionGroup.cs
- Material.cs
- BasicKeyConstraint.cs
- EndpointAddressMessageFilterTable.cs
- SqlConnectionFactory.cs
- AllMembershipCondition.cs
- Visual3D.cs
- QueryPageSettingsEventArgs.cs
- RunWorkerCompletedEventArgs.cs
- RemotingSurrogateSelector.cs
- Attributes.cs
- CertificateManager.cs
- XmlSchema.cs
- NavigatingCancelEventArgs.cs
- OutputScope.cs
- CodeBlockBuilder.cs
- UnicodeEncoding.cs
- Helper.cs
- NumericUpDown.cs
- WebBrowsableAttribute.cs
- Connector.xaml.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- TraceLog.cs
- DrawingContextDrawingContextWalker.cs
- TimeZone.cs
- MiniAssembly.cs
- FontStretches.cs
- StaticTextPointer.cs
- CompilationPass2Task.cs
- ReadOnlyAttribute.cs
- XmlDataSourceNodeDescriptor.cs
- CommandEventArgs.cs
- precedingsibling.cs
- EditorZone.cs
- HttpListenerException.cs
- HttpRawResponse.cs
- DataServiceQuery.cs
- DateTimeOffsetStorage.cs
- NoResizeHandleGlyph.cs
- KeyedPriorityQueue.cs
- HandleRef.cs
- ConfigXmlCDataSection.cs
- RedistVersionInfo.cs
- CreateParams.cs
- SymDocumentType.cs
- Rfc4050KeyFormatter.cs
- XmlSchemaException.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- ListViewGroup.cs
- WebPartMenuStyle.cs
- codemethodreferenceexpression.cs
- DbMetaDataFactory.cs
- StorageTypeMapping.cs
- DecoderFallback.cs
- PrimitiveXmlSerializers.cs
- CodeVariableReferenceExpression.cs
- FontUnitConverter.cs
- CanonicalizationDriver.cs
- OleDbRowUpdatingEvent.cs
- StyleCollection.cs
- Style.cs
- MachineKeySection.cs
- Size3D.cs
- QueryRewriter.cs
- Site.cs
- HttpBufferlessInputStream.cs
- ContentType.cs
- Matrix.cs
- WebScriptEndpoint.cs
- ByteViewer.cs
- GroupQuery.cs
- BuildProviderAppliesToAttribute.cs
- BufferModeSettings.cs
- ZipIOCentralDirectoryBlock.cs
- SchemaImporterExtensionElementCollection.cs
- ObjectStateManagerMetadata.cs
- OperatingSystem.cs
- Track.cs
- TabletDevice.cs
- MeasureItemEvent.cs
- StringFunctions.cs
- ConstraintStruct.cs
- dataprotectionpermission.cs
- MarkupCompilePass1.cs
- RichTextBox.cs
- DocumentSchemaValidator.cs
- FrameAutomationPeer.cs
- CodeRemoveEventStatement.cs
- InputGestureCollection.cs
- DefaultAuthorizationContext.cs
- DetailsViewModeEventArgs.cs
- Matrix3DConverter.cs
- xml.cs
- CollectionsUtil.cs
- CapabilitiesAssignment.cs
- SwitchLevelAttribute.cs
- SelectionItemProviderWrapper.cs
- XmlSerializerSection.cs
- SizeChangedInfo.cs