Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlNamespaceManager.cs
- MappingItemCollection.cs
- DatasetMethodGenerator.cs
- EventDescriptor.cs
- PrintPageEvent.cs
- DataList.cs
- AnnotationResource.cs
- ObjectRef.cs
- ToolStripDropDownClosingEventArgs.cs
- AsymmetricKeyExchangeFormatter.cs
- TextContainerChangedEventArgs.cs
- Size.cs
- FixedSOMContainer.cs
- Code.cs
- XmlBoundElement.cs
- DesignerAutoFormat.cs
- PenLineJoinValidation.cs
- Literal.cs
- TypeLibConverter.cs
- DefaultCommandConverter.cs
- ScrollProperties.cs
- RadioButtonBaseAdapter.cs
- ThreadStateException.cs
- SystemGatewayIPAddressInformation.cs
- HttpRequest.cs
- Rule.cs
- ObjectSelectorEditor.cs
- SolidColorBrush.cs
- OleDbRowUpdatedEvent.cs
- WindowsGraphics.cs
- InvalidContentTypeException.cs
- MetadataFile.cs
- QuarticEase.cs
- Timer.cs
- CustomAttribute.cs
- FileDialogPermission.cs
- InheritanceContextChangedEventManager.cs
- TiffBitmapEncoder.cs
- BuildResult.cs
- HtmlContainerControl.cs
- shaperfactory.cs
- ModifierKeysValueSerializer.cs
- TraceHandlerErrorFormatter.cs
- SessionPageStatePersister.cs
- BufferedOutputStream.cs
- SqlCachedBuffer.cs
- CompositeActivityDesigner.cs
- VariantWrapper.cs
- DrawingGroupDrawingContext.cs
- XPathAxisIterator.cs
- FileDialogCustomPlace.cs
- DataMemberFieldConverter.cs
- ColumnPropertiesGroup.cs
- FactoryRecord.cs
- PageThemeCodeDomTreeGenerator.cs
- Native.cs
- XmlDataCollection.cs
- HtmlInputHidden.cs
- TrustLevelCollection.cs
- ReflectionTypeLoadException.cs
- DoubleLink.cs
- TraceUtils.cs
- PostBackTrigger.cs
- ExpandCollapsePattern.cs
- PageContent.cs
- Enlistment.cs
- EventPropertyMap.cs
- URLIdentityPermission.cs
- FtpRequestCacheValidator.cs
- SocketException.cs
- QueryReaderSettings.cs
- ClientRolePrincipal.cs
- GridViewItemAutomationPeer.cs
- BindValidationContext.cs
- DetailsViewInsertedEventArgs.cs
- TraceEventCache.cs
- HttpException.cs
- TypedElement.cs
- TraceListeners.cs
- PrintDialogException.cs
- SqlTriggerContext.cs
- TextServicesContext.cs
- InvalidOperationException.cs
- QueryCursorEventArgs.cs
- CriticalHandle.cs
- CommentEmitter.cs
- WebPartConnectionsCancelVerb.cs
- SettingsPropertyIsReadOnlyException.cs
- SQLDateTimeStorage.cs
- ItemList.cs
- AssociationEndMember.cs
- ExpressionBuilderCollection.cs
- AnnotationHelper.cs
- AssociationSetMetadata.cs
- SingleObjectCollection.cs
- HMACSHA1.cs
- PinnedBufferMemoryStream.cs
- ActivitySurrogateSelector.cs
- figurelengthconverter.cs
- XmlSchemaAppInfo.cs