Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlButton.cs
- DataGridViewLinkColumn.cs
- XmlSchemaCompilationSettings.cs
- SplitterEvent.cs
- BreakRecordTable.cs
- Baml2006KeyRecord.cs
- WebPartDescription.cs
- linebase.cs
- SecurityBindingElementImporter.cs
- RegexGroup.cs
- ClientSection.cs
- SetStateEventArgs.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ImmutableObjectAttribute.cs
- LZCodec.cs
- DeferredElementTreeState.cs
- ObjectCache.cs
- TraceXPathNavigator.cs
- BindingGraph.cs
- TaskHelper.cs
- CollectionDataContractAttribute.cs
- SaveFileDialog.cs
- XmlNodeComparer.cs
- RemotingSurrogateSelector.cs
- SafeEventLogWriteHandle.cs
- TextSelectionProcessor.cs
- WorkflowCompensationBehavior.cs
- SqlFunctionAttribute.cs
- XmlSerializerNamespaces.cs
- SiteMapSection.cs
- rsa.cs
- QuaternionAnimationBase.cs
- SrgsElementList.cs
- FusionWrap.cs
- SafeNativeMethods.cs
- SelectionWordBreaker.cs
- SoapFault.cs
- WS2007FederationHttpBindingCollectionElement.cs
- ShaderEffect.cs
- WebSysDisplayNameAttribute.cs
- ZoneIdentityPermission.cs
- GridViewSelectEventArgs.cs
- GridLengthConverter.cs
- Oid.cs
- MailAddressCollection.cs
- WebPartDisplayModeCollection.cs
- Padding.cs
- _ListenerAsyncResult.cs
- ProcessModuleCollection.cs
- formatter.cs
- SqlDataReader.cs
- Quaternion.cs
- ScrollViewerAutomationPeer.cs
- DataObjectFieldAttribute.cs
- BaseCollection.cs
- TableLayoutCellPaintEventArgs.cs
- PkcsMisc.cs
- NativeMethods.cs
- SqlClientPermission.cs
- Rotation3D.cs
- AutomationPeer.cs
- _NtlmClient.cs
- WinOEToolBoxItem.cs
- BaseDataList.cs
- GZipStream.cs
- Matrix3DConverter.cs
- Page.cs
- TransformPatternIdentifiers.cs
- InProcStateClientManager.cs
- XmlnsCompatibleWithAttribute.cs
- ClientScriptManager.cs
- ComUdtElement.cs
- StatusBarDrawItemEvent.cs
- TextServicesContext.cs
- Polygon.cs
- ImageFormatConverter.cs
- MissingManifestResourceException.cs
- Certificate.cs
- DataGridViewCellMouseEventArgs.cs
- XslAst.cs
- WebPartCancelEventArgs.cs
- CompositeControlDesigner.cs
- ExcludePathInfo.cs
- RegexInterpreter.cs
- ThaiBuddhistCalendar.cs
- ClipboardData.cs
- ResourceManagerWrapper.cs
- XmlSchemaElement.cs
- CodeIdentifier.cs
- GeneralTransform2DTo3DTo2D.cs
- MeasureItemEvent.cs
- InternalRelationshipCollection.cs
- MD5.cs
- HttpCookiesSection.cs
- Condition.cs
- ApplicationBuildProvider.cs
- SqlReorderer.cs
- FormsAuthenticationConfiguration.cs
- WebPartConnectionCollection.cs
- ScrollBarRenderer.cs