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
- OdbcReferenceCollection.cs
- COSERVERINFO.cs
- PointKeyFrameCollection.cs
- LineInfo.cs
- RbTree.cs
- ResolvedKeyFrameEntry.cs
- ComplexTypeEmitter.cs
- DesignTimeTemplateParser.cs
- RoutedEventArgs.cs
- WriteableBitmap.cs
- ContentFileHelper.cs
- Preprocessor.cs
- ColorContext.cs
- DocumentViewerAutomationPeer.cs
- BridgeDataRecord.cs
- DesignerHelpers.cs
- ContentElementAutomationPeer.cs
- FocusChangedEventArgs.cs
- HandlerBase.cs
- Hash.cs
- Lazy.cs
- WindowsRebar.cs
- Method.cs
- HttpPostedFile.cs
- Wildcard.cs
- SharedStatics.cs
- MaterialCollection.cs
- ComponentManagerBroker.cs
- DecimalConverter.cs
- ListParagraph.cs
- RemoteX509AsymmetricSecurityKey.cs
- AddInStore.cs
- FixedFlowMap.cs
- IDReferencePropertyAttribute.cs
- CorrelationToken.cs
- ConstructorArgumentAttribute.cs
- AuthenticationServiceManager.cs
- TransformGroup.cs
- Win32Native.cs
- XmlSchemaCollection.cs
- EntityDataSourceMemberPath.cs
- SimpleHandlerFactory.cs
- MaskedTextBoxTextEditor.cs
- FusionWrap.cs
- ConfigurationLockCollection.cs
- ToolStripMenuItemDesigner.cs
- QuaternionValueSerializer.cs
- SafeSecurityHelper.cs
- RegexCode.cs
- FormViewCommandEventArgs.cs
- BaseDataList.cs
- RewritingPass.cs
- NCryptSafeHandles.cs
- DictionaryChange.cs
- Menu.cs
- VirtualStackFrame.cs
- UnsafeCollabNativeMethods.cs
- SessionEndedEventArgs.cs
- StringPropertyBuilder.cs
- ExclusiveTcpTransportManager.cs
- RowVisual.cs
- AnnotationResourceChangedEventArgs.cs
- PersistChildrenAttribute.cs
- TypeInitializationException.cs
- RawStylusInputCustomData.cs
- ComplexObject.cs
- RootCodeDomSerializer.cs
- Pens.cs
- CodeVariableReferenceExpression.cs
- DataGridViewColumnDesigner.cs
- ParameterBuilder.cs
- TransformerInfo.cs
- AudioLevelUpdatedEventArgs.cs
- Restrictions.cs
- IndentedWriter.cs
- QueryOutputWriterV1.cs
- TableAdapterManagerMethodGenerator.cs
- RuleElement.cs
- DesignerCategoryAttribute.cs
- CalendarItem.cs
- SqlReferenceCollection.cs
- DefaultAuthorizationContext.cs
- Baml2006KnownTypes.cs
- CodeDirectoryCompiler.cs
- DispatcherSynchronizationContext.cs
- AudioFormatConverter.cs
- ApplicationManager.cs
- RepeaterCommandEventArgs.cs
- MultitargetUtil.cs
- NegotiationTokenAuthenticatorState.cs
- CodeIndexerExpression.cs
- PageBuildProvider.cs
- ClientSideProviderDescription.cs
- TagPrefixInfo.cs
- IsolatedStorageException.cs
- AttributeTableBuilder.cs
- JsonDataContract.cs
- HandledMouseEvent.cs
- ForEachDesigner.xaml.cs
- XmlIgnoreAttribute.cs