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
- DataGridViewImageColumn.cs
- WebExceptionStatus.cs
- DataListItemCollection.cs
- ByeOperationCD1AsyncResult.cs
- CellTreeNode.cs
- ipaddressinformationcollection.cs
- IntSecurity.cs
- XmlSchemaAttributeGroupRef.cs
- MouseCaptureWithinProperty.cs
- GetRecipientListRequest.cs
- tooltip.cs
- NumericUpDownAcceleration.cs
- TraceSwitch.cs
- BackgroundFormatInfo.cs
- HitTestParameters.cs
- WmlImageAdapter.cs
- LayoutEditorPart.cs
- DependencyPropertyAttribute.cs
- _HelperAsyncResults.cs
- ImmComposition.cs
- ManagedCodeMarkers.cs
- XmlSubtreeReader.cs
- TextReader.cs
- Rotation3DAnimationUsingKeyFrames.cs
- DisplayNameAttribute.cs
- XmlFileEditor.cs
- AccessDataSource.cs
- ProcessStartInfo.cs
- QilFactory.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- LinqDataView.cs
- AssemblyUtil.cs
- DataGridViewCheckBoxCell.cs
- NetWebProxyFinder.cs
- TypedRowGenerator.cs
- Events.cs
- RectConverter.cs
- DiagnosticStrings.cs
- AnimationTimeline.cs
- DataGridViewColumnStateChangedEventArgs.cs
- CaseInsensitiveComparer.cs
- HttpCacheVaryByContentEncodings.cs
- ResourceCollectionInfo.cs
- TargetParameterCountException.cs
- SecurityContextSecurityTokenAuthenticator.cs
- ExternalException.cs
- ItemCheckedEvent.cs
- RtfToken.cs
- XD.cs
- AutoResetEvent.cs
- DependencyStoreSurrogate.cs
- CollectionBuilder.cs
- SqlConnection.cs
- DataGridViewSelectedRowCollection.cs
- RightsManagementEncryptedStream.cs
- SystemWebCachingSectionGroup.cs
- StylusDevice.cs
- KnownColorTable.cs
- TypeGeneratedEventArgs.cs
- ModuleBuilderData.cs
- SchemaImporterExtension.cs
- PointAnimationBase.cs
- LongValidator.cs
- NeutralResourcesLanguageAttribute.cs
- Fonts.cs
- PlainXmlSerializer.cs
- TextViewBase.cs
- NetworkInformationPermission.cs
- BinaryMethodMessage.cs
- TcpSocketManager.cs
- InternalSendMessage.cs
- QueryAccessibilityHelpEvent.cs
- ShaderEffect.cs
- SettingsPropertyValueCollection.cs
- Repeater.cs
- ColorDialog.cs
- ToolStripSettings.cs
- DecoderReplacementFallback.cs
- SemanticAnalyzer.cs
- FilteredDataSetHelper.cs
- HostingEnvironment.cs
- ListViewItemEventArgs.cs
- Normalization.cs
- ObjectQueryExecutionPlan.cs
- ProxyGenerator.cs
- AsyncOperation.cs
- BaseComponentEditor.cs
- SByteStorage.cs
- CodeNamespaceCollection.cs
- MappingMetadataHelper.cs
- RuleInfoComparer.cs
- Timer.cs
- BinaryObjectReader.cs
- UnsafeNativeMethods.cs
- UpdatePanelTriggerCollection.cs
- CodeNamespaceImport.cs
- Int32EqualityComparer.cs
- UTF32Encoding.cs
- ContentDesigner.cs
- EntityDataSource.cs