Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- RegexRunnerFactory.cs
- Visual3D.cs
- ModifierKeysConverter.cs
- DrawingGroupDrawingContext.cs
- ObservableCollection.cs
- TableLayoutSettings.cs
- PackagePartCollection.cs
- ServiceModelExtensionCollectionElement.cs
- VideoDrawing.cs
- XmlSerializerFactory.cs
- DateTimeOffset.cs
- ClientBuildManager.cs
- AppDomainAttributes.cs
- IPAddress.cs
- DesignerAttribute.cs
- Clock.cs
- DataSourceCache.cs
- WindowAutomationPeer.cs
- ItemDragEvent.cs
- LateBoundBitmapDecoder.cs
- ClipboardProcessor.cs
- TagMapCollection.cs
- WebPartMinimizeVerb.cs
- Repeater.cs
- DataGridViewRowsRemovedEventArgs.cs
- MetadataUtilsSmi.cs
- XmlValueConverter.cs
- System.Data_BID.cs
- ReflectionHelper.cs
- WizardPanelChangingEventArgs.cs
- TextWriterEngine.cs
- RefreshEventArgs.cs
- StickyNoteHelper.cs
- ResourcesBuildProvider.cs
- TrustSection.cs
- PaperSource.cs
- ExtentCqlBlock.cs
- RadialGradientBrush.cs
- StyleXamlParser.cs
- TextEffectResolver.cs
- _HeaderInfo.cs
- CheckBox.cs
- BaseProcessor.cs
- ChangeBlockUndoRecord.cs
- AdvancedBindingEditor.cs
- SqlConnectionStringBuilder.cs
- SByte.cs
- xmlsaver.cs
- EmptyEnumerator.cs
- CommandHelper.cs
- OleDbConnectionInternal.cs
- LateBoundChannelParameterCollection.cs
- TraceEventCache.cs
- QueryCreatedEventArgs.cs
- ListViewDeleteEventArgs.cs
- MergePropertyDescriptor.cs
- FixedTextSelectionProcessor.cs
- LineServices.cs
- StringFunctions.cs
- SafeCryptoHandles.cs
- TextWriterEngine.cs
- SwitchExpression.cs
- XpsDocument.cs
- Win32SafeHandles.cs
- SqlUnionizer.cs
- SafeCoTaskMem.cs
- EventArgs.cs
- PrtCap_Reader.cs
- VideoDrawing.cs
- SiteMapNodeItemEventArgs.cs
- RelationalExpressions.cs
- XmlDataCollection.cs
- MasterPageBuildProvider.cs
- _LoggingObject.cs
- CreateUserWizardStep.cs
- brushes.cs
- XmlNodeWriter.cs
- LinqDataSourceDisposeEventArgs.cs
- WorkflowApplicationEventArgs.cs
- ColorKeyFrameCollection.cs
- peernodeimplementation.cs
- ReaderWriterLock.cs
- FlowDocumentPage.cs
- InputLangChangeRequestEvent.cs
- CryptoConfig.cs
- HostingEnvironmentException.cs
- DiscoveryClientProtocol.cs
- WebControl.cs
- Label.cs
- AssertFilter.cs
- SelectedDatesCollection.cs
- GridViewRowEventArgs.cs
- DrawingContextWalker.cs
- FormatConvertedBitmap.cs
- DesignerHelpers.cs
- iisPickupDirectory.cs
- ChannelSinkStacks.cs
- WebZoneDesigner.cs
- EUCJPEncoding.cs
- ProjectedWrapper.cs