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
- WebBrowser.cs
- GetImportedCardRequest.cs
- DoubleCollection.cs
- ComPlusTraceRecord.cs
- WorkflowInstanceExtensionProvider.cs
- ContextStack.cs
- EditCommandColumn.cs
- StructuralType.cs
- AncestorChangedEventArgs.cs
- XsltOutput.cs
- BuildDependencySet.cs
- FixedFlowMap.cs
- HtmlElement.cs
- RequestCache.cs
- EncryptedXml.cs
- httpserverutility.cs
- DesignerFrame.cs
- XmlSerializerSection.cs
- initElementDictionary.cs
- ComponentDispatcherThread.cs
- SizeChangedInfo.cs
- ExceptionUtil.cs
- Table.cs
- mactripleDES.cs
- CodeSnippetStatement.cs
- TransactionProxy.cs
- SafeRightsManagementSessionHandle.cs
- Int16.cs
- DbUpdateCommandTree.cs
- Table.cs
- WpfKnownTypeInvoker.cs
- ToolStripPanelCell.cs
- VirtualizingStackPanel.cs
- Int32Rect.cs
- Convert.cs
- Point3DConverter.cs
- IsolatedStoragePermission.cs
- ConnectionProviderAttribute.cs
- PrimaryKeyTypeConverter.cs
- ArgumentException.cs
- CountdownEvent.cs
- WorkflowQueueInfo.cs
- DataGridViewCellParsingEventArgs.cs
- EntityDesignerDataSourceView.cs
- RequestCachePolicy.cs
- DiagnosticEventProvider.cs
- CaretElement.cs
- WorkflowOperationAsyncResult.cs
- MiniAssembly.cs
- DispatcherExceptionEventArgs.cs
- AnimationStorage.cs
- Geometry3D.cs
- CriticalFileToken.cs
- DbConnectionStringBuilder.cs
- TextChangedEventArgs.cs
- XmlEncodedRawTextWriter.cs
- ContractNamespaceAttribute.cs
- filewebresponse.cs
- StreamHelper.cs
- SpellCheck.cs
- ForceCopyBuildProvider.cs
- dbdatarecord.cs
- PrimitiveType.cs
- FontFamily.cs
- WaitHandleCannotBeOpenedException.cs
- Debug.cs
- PkcsMisc.cs
- ObjectQueryProvider.cs
- ClockGroup.cs
- OdbcConnectionFactory.cs
- DataGridViewLinkCell.cs
- _RequestCacheProtocol.cs
- TextCollapsingProperties.cs
- QueryOutputWriter.cs
- FrameworkElementAutomationPeer.cs
- DataGridViewToolTip.cs
- LongValidator.cs
- XmlSignatureProperties.cs
- EntityDataSourceSelectedEventArgs.cs
- Highlights.cs
- DataFormats.cs
- RegexStringValidator.cs
- XmlText.cs
- DbConnectionPoolGroup.cs
- StrokeNodeOperations2.cs
- TransportSecurityHelpers.cs
- XmlExceptionHelper.cs
- Socket.cs
- LogEntrySerializer.cs
- DataTableTypeConverter.cs
- HwndMouseInputProvider.cs
- Peer.cs
- Part.cs
- DataSetMappper.cs
- BuildProvidersCompiler.cs
- QuaternionAnimationUsingKeyFrames.cs
- TableLayoutPanelCellPosition.cs
- DBSchemaTable.cs
- Wildcard.cs
- WsatEtwTraceListener.cs