Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DictionaryManager.cs
- SpAudioStreamWrapper.cs
- PopupRoot.cs
- WebEvents.cs
- DataSourceGeneratorException.cs
- DefaultMemberAttribute.cs
- InternalPermissions.cs
- SqlDelegatedTransaction.cs
- PagedDataSource.cs
- EpmContentDeSerializer.cs
- WebPartAddingEventArgs.cs
- DesignTimeParseData.cs
- DataServiceExpressionVisitor.cs
- ParallelTimeline.cs
- SystemIPGlobalStatistics.cs
- FtpRequestCacheValidator.cs
- srgsitem.cs
- LinqDataSourceInsertEventArgs.cs
- Compiler.cs
- OfTypeExpression.cs
- X509Certificate.cs
- XmlSchemas.cs
- QuerySubExprEliminator.cs
- ChannelAcceptor.cs
- Button.cs
- metadatamappinghashervisitor.cs
- InternalBase.cs
- EnvironmentPermission.cs
- IsolatedStoragePermission.cs
- BamlTreeUpdater.cs
- ManagementInstaller.cs
- HttpCachePolicyElement.cs
- TagNameToTypeMapper.cs
- ListViewGroupConverter.cs
- __Filters.cs
- ScriptReference.cs
- WebPartMenuStyle.cs
- OdbcError.cs
- BrowsableAttribute.cs
- HttpCapabilitiesBase.cs
- ReadOnlyDataSourceView.cs
- ResourcesChangeInfo.cs
- ToolstripProfessionalRenderer.cs
- ConnectionStringSettings.cs
- StringExpressionSet.cs
- ListViewCommandEventArgs.cs
- PagesSection.cs
- TypeSystem.cs
- LabelDesigner.cs
- BitSet.cs
- DataServiceHost.cs
- CodeTypeReferenceCollection.cs
- XmlDataCollection.cs
- SqlMethodTransformer.cs
- _HeaderInfoTable.cs
- LinkClickEvent.cs
- BitmapDownload.cs
- BmpBitmapEncoder.cs
- DisplayNameAttribute.cs
- DefaultHttpHandler.cs
- AuthenticationModuleElementCollection.cs
- TransformerInfo.cs
- NumberSubstitution.cs
- MenuItemCollection.cs
- ConfigurationStrings.cs
- ValueConversionAttribute.cs
- FontDialog.cs
- NavigationHelper.cs
- HttpWebResponse.cs
- Setter.cs
- AttachmentCollection.cs
- ComboBox.cs
- ImageConverter.cs
- PropertyEntry.cs
- WebBrowserProgressChangedEventHandler.cs
- Query.cs
- XmlWellformedWriterHelpers.cs
- CodeGeneratorOptions.cs
- CodeDomConfigurationHandler.cs
- PackUriHelper.cs
- DataGridViewColumnStateChangedEventArgs.cs
- PointCollectionConverter.cs
- CqlIdentifiers.cs
- Mapping.cs
- MethodCallExpression.cs
- ProcessingInstructionAction.cs
- TransformerTypeCollection.cs
- DataBinding.cs
- UnsupportedPolicyOptionsException.cs
- RowUpdatingEventArgs.cs
- ContractCodeDomInfo.cs
- KnowledgeBase.cs
- DecimalConverter.cs
- ConfigXmlWhitespace.cs
- Tokenizer.cs
- RoutedCommand.cs
- SafeCoTaskMem.cs
- TrustLevel.cs
- MetaModel.cs
- Expressions.cs