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
- QualifiedCellIdBoolean.cs
- EntityConnectionStringBuilderItem.cs
- WindowsGrip.cs
- Property.cs
- MessageSmuggler.cs
- DrawingCollection.cs
- Interop.cs
- MSHTMLHost.cs
- XmlSchemaGroup.cs
- LineGeometry.cs
- SizeIndependentAnimationStorage.cs
- WmpBitmapDecoder.cs
- QueryTaskGroupState.cs
- XmlWriterTraceListener.cs
- DrawingContextWalker.cs
- FlowLayout.cs
- WinFormsUtils.cs
- XmlDataLoader.cs
- URL.cs
- ByteStreamGeometryContext.cs
- DocumentsTrace.cs
- ObjectQuery_EntitySqlExtensions.cs
- FixedFindEngine.cs
- BitmapCodecInfoInternal.cs
- HttpClientCertificate.cs
- NameNode.cs
- EventProviderClassic.cs
- CodeDomConfigurationHandler.cs
- StylusPointPropertyInfo.cs
- AccessControlEntry.cs
- ContentPlaceHolder.cs
- ImageCreator.cs
- DefinitionUpdate.cs
- CharUnicodeInfo.cs
- RouteItem.cs
- MarkupCompiler.cs
- RNGCryptoServiceProvider.cs
- DataGridViewColumnEventArgs.cs
- OutputScope.cs
- RegionInfo.cs
- ConfigPathUtility.cs
- ElementNotEnabledException.cs
- DynamicValidatorEventArgs.cs
- EventDescriptor.cs
- SplitterEvent.cs
- GridPatternIdentifiers.cs
- CodeSnippetExpression.cs
- DbReferenceCollection.cs
- XsltInput.cs
- CollectionBase.cs
- TransportChannelFactory.cs
- BasicExpandProvider.cs
- DelegatedStream.cs
- ExtendLockAsyncResult.cs
- UnsafeNativeMethods.cs
- HttpContextServiceHost.cs
- ExtentCqlBlock.cs
- QueryCoreOp.cs
- ADRoleFactory.cs
- DbParameterCollection.cs
- ConcurrentBag.cs
- XmlWrappingReader.cs
- BulletedList.cs
- SqlConnectionHelper.cs
- SingleAnimationUsingKeyFrames.cs
- String.cs
- ECDsaCng.cs
- ActivityCompletionCallbackWrapper.cs
- ConfigurationFileMap.cs
- TextFindEngine.cs
- TextTreeFixupNode.cs
- MessageQueueInstaller.cs
- ByteStack.cs
- EdmSchemaAttribute.cs
- WebBrowserBase.cs
- ProcessingInstructionAction.cs
- XmlSchemaInferenceException.cs
- SplitterDesigner.cs
- SymDocumentType.cs
- SByteConverter.cs
- objectquery_tresulttype.cs
- StylusPlugin.cs
- WebSysDisplayNameAttribute.cs
- ParameterEditorUserControl.cs
- PropertyGeneratedEventArgs.cs
- ProjectionCamera.cs
- BehaviorEditorPart.cs
- CheckBox.cs
- WebRequestModulesSection.cs
- ContentHostHelper.cs
- ValidationRule.cs
- SimpleLine.cs
- InternalConfigSettingsFactory.cs
- EventLog.cs
- Site.cs
- IntPtr.cs
- FormsIdentity.cs
- DbTransaction.cs
- ControlParameter.cs
- TextEndOfParagraph.cs