Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- CollectionType.cs
- PropertiesTab.cs
- DbSetClause.cs
- filewebrequest.cs
- Compilation.cs
- XmlDomTextWriter.cs
- ImageButton.cs
- UpdateException.cs
- SingleKeyFrameCollection.cs
- BindingListCollectionView.cs
- AspNetHostingPermission.cs
- CodeDOMProvider.cs
- HttpApplication.cs
- MediaElement.cs
- ItemCheckedEvent.cs
- XmlSchemaInferenceException.cs
- Matrix.cs
- SigningCredentials.cs
- Rethrow.cs
- FusionWrap.cs
- ClaimTypeElementCollection.cs
- ellipse.cs
- GenericAuthenticationEventArgs.cs
- ClassImporter.cs
- PackageStore.cs
- TreeNodeStyle.cs
- MostlySingletonList.cs
- BufferModeSettings.cs
- ImageAttributes.cs
- PhysicalFontFamily.cs
- RayHitTestParameters.cs
- XmlSchemaExternal.cs
- PublisherIdentityPermission.cs
- OdbcInfoMessageEvent.cs
- SqlTransaction.cs
- StringAnimationBase.cs
- GradientBrush.cs
- VarRemapper.cs
- MemberHolder.cs
- SqlProfileProvider.cs
- XmlProcessingInstruction.cs
- XmlWrappingWriter.cs
- BamlMapTable.cs
- tibetanshape.cs
- MdiWindowListStrip.cs
- _NegotiateClient.cs
- InnerItemCollectionView.cs
- DataSourceCacheDurationConverter.cs
- QueryRewriter.cs
- FigureParaClient.cs
- BuildProvider.cs
- ObjectCloneHelper.cs
- SqlDataSourceView.cs
- OleDbException.cs
- StrokeSerializer.cs
- SmiEventSink.cs
- CommentGlyph.cs
- LayoutManager.cs
- ConfigPathUtility.cs
- LoginCancelEventArgs.cs
- ConsoleTraceListener.cs
- WpfPayload.cs
- RankException.cs
- UnsafeNativeMethods.cs
- DataTableMapping.cs
- ExpressionBinding.cs
- DataObject.cs
- BaseDataBoundControl.cs
- RequestCachePolicy.cs
- CodeChecksumPragma.cs
- SQLGuid.cs
- DataGridrowEditEndingEventArgs.cs
- SortDescriptionCollection.cs
- DiagnosticTrace.cs
- IisTraceListener.cs
- ConnectionStringSettingsCollection.cs
- Types.cs
- SymLanguageVendor.cs
- TreeNodeStyleCollectionEditor.cs
- FixedSOMPageConstructor.cs
- _NetworkingPerfCounters.cs
- FixedSOMElement.cs
- AuthorizationSection.cs
- CollectionViewGroupInternal.cs
- WindowsFormsHelpers.cs
- IPHostEntry.cs
- BuildResult.cs
- LayoutExceptionEventArgs.cs
- RoutedEventHandlerInfo.cs
- CommunicationException.cs
- MessageSmuggler.cs
- AsymmetricCryptoHandle.cs
- LogicalExpr.cs
- FrameDimension.cs
- BitmapEditor.cs
- EntityDataSourceContextCreatedEventArgs.cs
- ListSortDescription.cs
- QueryOperationResponseOfT.cs
- Block.cs
- VariableAction.cs