Code:
/ FX-1434 / FX-1434 / 1.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
- TextFormatterContext.cs
- StringValidator.cs
- XmlDataSourceView.cs
- FontStretches.cs
- EntityTransaction.cs
- Vector3DConverter.cs
- WindowsBrush.cs
- XamlToRtfWriter.cs
- RawStylusInputReport.cs
- LocatorBase.cs
- SplashScreen.cs
- TableDetailsCollection.cs
- ReferenceConverter.cs
- RolePrincipal.cs
- XmlName.cs
- ResourceAttributes.cs
- MimePart.cs
- SiteMapNodeItemEventArgs.cs
- CheckBox.cs
- SecurityAlgorithmSuite.cs
- DataFormat.cs
- HelpInfo.cs
- StringOutput.cs
- wmiprovider.cs
- GridItemCollection.cs
- SymLanguageType.cs
- RightsManagementPermission.cs
- WpfSharedXamlSchemaContext.cs
- TextTreeObjectNode.cs
- WindowsRichEditRange.cs
- SoapExtensionTypeElementCollection.cs
- SerializationInfoEnumerator.cs
- DashStyles.cs
- DesignerOptionService.cs
- ZoneIdentityPermission.cs
- XmlSchemaFacet.cs
- AspNetSynchronizationContext.cs
- ConfigurationPropertyCollection.cs
- SerializationAttributes.cs
- KnownTypes.cs
- DocumentGrid.cs
- WindowsTokenRoleProvider.cs
- TextOnlyOutput.cs
- FeedUtils.cs
- BrowserCapabilitiesCompiler.cs
- ResourceDescriptionAttribute.cs
- MimeTypeAttribute.cs
- X509PeerCertificateAuthenticationElement.cs
- MasterPageParser.cs
- HtmlTableRowCollection.cs
- FormatterConverter.cs
- NonVisualControlAttribute.cs
- PolicyChain.cs
- AutoSizeToolBoxItem.cs
- XmlSchemaExporter.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- DataGridViewCellEventArgs.cs
- IndentedWriter.cs
- ExtensionDataReader.cs
- PipeStream.cs
- BamlLocalizableResource.cs
- EntityContainerAssociationSetEnd.cs
- RecognizerInfo.cs
- invalidudtexception.cs
- CalendarDay.cs
- EntityDataSourceView.cs
- QueryStringParameter.cs
- DynamicValueConverter.cs
- StateMachineWorkflowInstance.cs
- SQLStringStorage.cs
- MsmqEncryptionAlgorithm.cs
- Selection.cs
- VersionValidator.cs
- XmlResolver.cs
- ComboBoxAutomationPeer.cs
- QilList.cs
- RoleManagerSection.cs
- XmlQueryCardinality.cs
- Matrix3D.cs
- TemplateControlBuildProvider.cs
- HttpApplicationFactory.cs
- AsyncPostBackErrorEventArgs.cs
- SByteConverter.cs
- HtmlElementEventArgs.cs
- ObjectQuery_EntitySqlExtensions.cs
- CustomErrorsSection.cs
- ServiceModelConfigurationElementCollection.cs
- TypeForwardedFromAttribute.cs
- LeafCellTreeNode.cs
- EntityTypeBase.cs
- Soap.cs
- XmlText.cs
- mediaeventargs.cs
- ToolStripSeparator.cs
- PathSegment.cs
- CompilerGeneratedAttribute.cs
- TraceInternal.cs
- ping.cs
- GridPattern.cs
- Transform.cs