Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- CodeMethodReturnStatement.cs
- MdImport.cs
- XhtmlBasicLinkAdapter.cs
- WebPartHelpVerb.cs
- RadioButtonStandardAdapter.cs
- SimplePropertyEntry.cs
- StreamSecurityUpgradeProvider.cs
- FilterEventArgs.cs
- HatchBrush.cs
- GridViewEditEventArgs.cs
- BeginStoryboard.cs
- SqlUdtInfo.cs
- TextDecorationUnitValidation.cs
- ISAPIWorkerRequest.cs
- InputMethodStateChangeEventArgs.cs
- StringUtil.cs
- TheQuery.cs
- ImplicitInputBrush.cs
- EntityContainerRelationshipSet.cs
- PolyBezierSegment.cs
- ServerIdentity.cs
- ProtocolsSection.cs
- FieldToken.cs
- HttpResponseWrapper.cs
- CodeExpressionRuleDeclaration.cs
- ReachSerializableProperties.cs
- ErrorStyle.cs
- ElementHostPropertyMap.cs
- CqlBlock.cs
- SqlNotificationEventArgs.cs
- PathFigure.cs
- PresentationSource.cs
- TextContainer.cs
- ColorAnimation.cs
- ImageMapEventArgs.cs
- WebControlsSection.cs
- TypedRowGenerator.cs
- SqlWebEventProvider.cs
- RepeaterItem.cs
- FilterElement.cs
- DataSvcMapFileSerializer.cs
- xsdvalidator.cs
- activationcontext.cs
- ExpressionBinding.cs
- GridViewRowCollection.cs
- EffectiveValueEntry.cs
- SiteMapNode.cs
- DispatcherExceptionEventArgs.cs
- HtmlTitle.cs
- WindowsTab.cs
- TriggerBase.cs
- WebPartCancelEventArgs.cs
- GridViewCommandEventArgs.cs
- ProcessHost.cs
- SmiEventStream.cs
- TextElementEnumerator.cs
- HtmlForm.cs
- DataGridBoolColumn.cs
- Vector.cs
- FileReservationCollection.cs
- DefaultHttpHandler.cs
- SqlDataRecord.cs
- SqlPersonalizationProvider.cs
- XhtmlBasicLabelAdapter.cs
- Pts.cs
- TracingConnectionInitiator.cs
- ReaderWriterLock.cs
- AspCompat.cs
- ImageAttributes.cs
- HttpBindingExtension.cs
- MimeWriter.cs
- EntityViewGenerationAttribute.cs
- ClientData.cs
- SoapExtensionImporter.cs
- Authorization.cs
- XmlValidatingReaderImpl.cs
- RuntimeEnvironment.cs
- DBSchemaRow.cs
- ControlTemplate.cs
- Site.cs
- Attribute.cs
- WebPartConnectionsCancelEventArgs.cs
- CompiledRegexRunner.cs
- OdbcEnvironment.cs
- WSHttpBindingBase.cs
- TransformerTypeCollection.cs
- OperationFormatUse.cs
- ModuleConfigurationInfo.cs
- Calendar.cs
- Margins.cs
- ObjectDataSourceSelectingEventArgs.cs
- remotingproxy.cs
- WebPartActionVerb.cs
- RegexParser.cs
- ObjectDataSourceDisposingEventArgs.cs
- AttributeUsageAttribute.cs
- HwndKeyboardInputProvider.cs
- EntityDesignerUtils.cs
- MobileResource.cs
- GridViewPageEventArgs.cs