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
- XmlNamespaceManager.cs
- MarkupExtensionReturnTypeAttribute.cs
- CapiHashAlgorithm.cs
- DbDataReader.cs
- DataBoundControlHelper.cs
- ReflectPropertyDescriptor.cs
- RuntimeHelpers.cs
- CatalogPart.cs
- OutputCacheProfile.cs
- CodeValidator.cs
- PageCatalogPart.cs
- GeneralTransform3DGroup.cs
- ToolStripSystemRenderer.cs
- EventsTab.cs
- PropertyMetadata.cs
- EventTask.cs
- EndPoint.cs
- DataStreams.cs
- RawStylusInputCustomDataList.cs
- DelegateSerializationHolder.cs
- CodeConditionStatement.cs
- SqlPersonalizationProvider.cs
- IteratorDescriptor.cs
- ParserExtension.cs
- SecurityUtils.cs
- CheckBoxBaseAdapter.cs
- InitialServerConnectionReader.cs
- StylusCollection.cs
- DataSourceCollectionBase.cs
- NameScope.cs
- TransformValueSerializer.cs
- WindowsAuthenticationEventArgs.cs
- QuaternionAnimation.cs
- StreamAsIStream.cs
- IOThreadTimer.cs
- DBDataPermissionAttribute.cs
- COM2ExtendedBrowsingHandler.cs
- DataGridViewButtonColumn.cs
- ProxyWebPart.cs
- StrokeFIndices.cs
- RequestCachePolicyConverter.cs
- NotConverter.cs
- VisualTreeHelper.cs
- DoubleLinkListEnumerator.cs
- MinimizableAttributeTypeConverter.cs
- BrowserCapabilitiesFactory.cs
- DrawingVisual.cs
- SqlServer2KCompatibilityCheck.cs
- FactoryRecord.cs
- DataGridViewControlCollection.cs
- EncoderParameter.cs
- BinaryObjectInfo.cs
- ExternalDataExchangeService.cs
- ResourceDisplayNameAttribute.cs
- String.cs
- QilXmlReader.cs
- XmlBindingWorker.cs
- KeyPressEvent.cs
- KeyFrames.cs
- initElementDictionary.cs
- AsymmetricKeyExchangeDeformatter.cs
- SafeNativeMethodsMilCoreApi.cs
- FilterEventArgs.cs
- EnumerableRowCollectionExtensions.cs
- KoreanLunisolarCalendar.cs
- SubtreeProcessor.cs
- sortedlist.cs
- DataGridViewCellStyle.cs
- OleDbWrapper.cs
- CustomErrorsSection.cs
- Classification.cs
- ApplicationServiceManager.cs
- AlternateViewCollection.cs
- SignatureGenerator.cs
- MetadataArtifactLoaderCompositeFile.cs
- TypeExtensionConverter.cs
- UnsafeNativeMethods.cs
- WizardForm.cs
- SafeNativeMethods.cs
- MailDefinitionBodyFileNameEditor.cs
- _SecureChannel.cs
- ToolBarTray.cs
- ToolboxItemAttribute.cs
- FloaterParaClient.cs
- AdjustableArrowCap.cs
- DLinqAssociationProvider.cs
- Resources.Designer.cs
- DocumentReferenceCollection.cs
- OracleMonthSpan.cs
- TraceXPathNavigator.cs
- FlowDocumentPaginator.cs
- TextBox.cs
- DataProviderNameConverter.cs
- Operators.cs
- NetworkAddressChange.cs
- SqlMethodAttribute.cs
- StickyNoteAnnotations.cs
- shaperfactoryquerycachekey.cs
- DataShape.cs
- ListSourceHelper.cs