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
- SqlMetaData.cs
- CounterNameConverter.cs
- SmtpReplyReader.cs
- MSHTMLHost.cs
- WebServiceParameterData.cs
- TextEmbeddedObject.cs
- InheritanceService.cs
- GridViewColumnHeader.cs
- ListSurrogate.cs
- UIHelper.cs
- EndpointAddressAugust2004.cs
- SslStreamSecurityElement.cs
- Filter.cs
- HighlightVisual.cs
- safex509handles.cs
- PrintControllerWithStatusDialog.cs
- CryptoApi.cs
- BitmapFrameEncode.cs
- ObjectDataProvider.cs
- TemplateInstanceAttribute.cs
- InputEventArgs.cs
- OleDbRowUpdatedEvent.cs
- DefaultShape.cs
- ThreadAbortException.cs
- ProxyElement.cs
- ValueUtilsSmi.cs
- CodeSnippetStatement.cs
- XmlIterators.cs
- WriteableBitmap.cs
- ToolStripOverflow.cs
- MatrixTransform3D.cs
- TriState.cs
- SafeNativeMethods.cs
- DelegatingStream.cs
- EntityParameter.cs
- InputProviderSite.cs
- ConfigErrorGlyph.cs
- SID.cs
- GraphicsContainer.cs
- WebGetAttribute.cs
- SqlAliasesReferenced.cs
- HttpResponseInternalBase.cs
- AuthenticationModuleElement.cs
- PenContext.cs
- MobileCategoryAttribute.cs
- LinqDataSourceContextEventArgs.cs
- MultiView.cs
- RSACryptoServiceProvider.cs
- LambdaValue.cs
- FileIOPermission.cs
- Graphics.cs
- StatusStrip.cs
- SystemUnicastIPAddressInformation.cs
- MaterialCollection.cs
- HintTextMaxWidthConverter.cs
- DeploymentSectionCache.cs
- RoutedCommand.cs
- TypeDescriptionProvider.cs
- Comparer.cs
- XmlFormatExtensionPointAttribute.cs
- DesignSurfaceEvent.cs
- ProxyHelper.cs
- BindingParameterCollection.cs
- FixedSOMLineCollection.cs
- VisualStyleInformation.cs
- TryExpression.cs
- DesignerLoader.cs
- ContainerControl.cs
- XsdSchemaFileEditor.cs
- StaticExtensionConverter.cs
- FlowNode.cs
- MemoryPressure.cs
- RegionIterator.cs
- CalendarItem.cs
- CodeAttachEventStatement.cs
- ConfigurationProperty.cs
- TextUtf8RawTextWriter.cs
- DrawingCollection.cs
- PropertyMapper.cs
- MatrixAnimationUsingKeyFrames.cs
- Triangle.cs
- RSATokenProvider.cs
- GridItemPattern.cs
- WebFormDesignerActionService.cs
- FlowDocumentPaginator.cs
- ChannelSinkStacks.cs
- ExceptionHandlersDesigner.cs
- ModelItemCollectionImpl.cs
- BindingNavigator.cs
- ResourceContainer.cs
- XmlJsonReader.cs
- EntityCollection.cs
- JoinSymbol.cs
- BaseAsyncResult.cs
- NetworkAddressChange.cs
- sitestring.cs
- TreeViewEvent.cs
- CalendarBlackoutDatesCollection.cs
- TextTreePropertyUndoUnit.cs
- CallbackException.cs