Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Bold.cs
- StorageBasedPackageProperties.cs
- GridViewEditEventArgs.cs
- ContainerUIElement3D.cs
- JavaScriptSerializer.cs
- _NTAuthentication.cs
- DSASignatureFormatter.cs
- DesignerValidatorAdapter.cs
- SqlDesignerDataSourceView.cs
- DetailsViewRow.cs
- CorrelationTokenInvalidatedHandler.cs
- TcpStreams.cs
- WindowsStatusBar.cs
- InkCanvasSelection.cs
- ListView.cs
- SmtpAuthenticationManager.cs
- SecurityDescriptor.cs
- SchemaAttDef.cs
- PropertyInformationCollection.cs
- RequestCachingSection.cs
- FileResponseElement.cs
- StrongNameMembershipCondition.cs
- XmlDataDocument.cs
- listviewsubitemcollectioneditor.cs
- EndOfStreamException.cs
- ClientTarget.cs
- OdbcConnectionStringbuilder.cs
- SafeCoTaskMem.cs
- ByteStorage.cs
- ByteAnimation.cs
- Inflater.cs
- XmlArrayItemAttributes.cs
- XmlDictionary.cs
- SqlDataSourceView.cs
- mactripleDES.cs
- DLinqAssociationProvider.cs
- ReservationCollection.cs
- AdornerHitTestResult.cs
- KeyInterop.cs
- QueryStringParameter.cs
- ReflectEventDescriptor.cs
- PageCatalogPart.cs
- ServiceObjectContainer.cs
- WebCategoryAttribute.cs
- SharedDp.cs
- WinFormsSpinner.cs
- AsymmetricSignatureFormatter.cs
- SqlDataSourceCommandEventArgs.cs
- GenericPrincipal.cs
- PhysicalFontFamily.cs
- DbDataRecord.cs
- BitmapVisualManager.cs
- InvalidFilterCriteriaException.cs
- DecimalKeyFrameCollection.cs
- XmlQualifiedName.cs
- XmlDocument.cs
- WindowsListViewGroupSubsetLink.cs
- WmiInstallComponent.cs
- control.ime.cs
- Binding.cs
- WebPartCloseVerb.cs
- WindowsListViewGroup.cs
- KeyValuePairs.cs
- TreeViewHitTestInfo.cs
- SHA1CryptoServiceProvider.cs
- HighlightComponent.cs
- IsolatedStorageFileStream.cs
- Pool.cs
- SHA1.cs
- WebSysDescriptionAttribute.cs
- SqlTypeConverter.cs
- EntityProviderFactory.cs
- ImageListUtils.cs
- SqlProfileProvider.cs
- BitmapEffectDrawing.cs
- CheckPair.cs
- WebProxyScriptElement.cs
- RootBuilder.cs
- MobileTemplatedControlDesigner.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- QuadraticBezierSegment.cs
- TargetControlTypeAttribute.cs
- QueuePathEditor.cs
- DataGridViewCheckBoxCell.cs
- MemoryStream.cs
- RemotingException.cs
- ClientScriptManager.cs
- SizeAnimation.cs
- XmlSchemaProviderAttribute.cs
- PersianCalendar.cs
- RuntimeWrappedException.cs
- ViewPort3D.cs
- LocatorPart.cs
- SafeBitVector32.cs
- AxisAngleRotation3D.cs
- NetNamedPipeBindingCollectionElement.cs
- XmlCodeExporter.cs
- UndirectedGraph.cs
- MemberInfoSerializationHolder.cs
- ImageConverter.cs