Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DataFieldConverter.cs
- ButtonBase.cs
- ProcessManager.cs
- AttachedPropertyDescriptor.cs
- DataSourceProvider.cs
- NativeCompoundFileAPIs.cs
- CompositeCollection.cs
- HttpCacheVaryByContentEncodings.cs
- FixedDocumentPaginator.cs
- ComAdminInterfaces.cs
- TypeSystem.cs
- ProfileManager.cs
- GridItemPatternIdentifiers.cs
- ParserHooks.cs
- CardSpaceSelector.cs
- ControlValuePropertyAttribute.cs
- OleDbConnection.cs
- TimeSpanValidatorAttribute.cs
- ConnectionManagementSection.cs
- MouseOverProperty.cs
- DocumentAutomationPeer.cs
- PrintDialog.cs
- ForeignConstraint.cs
- PrivateFontCollection.cs
- DragDeltaEventArgs.cs
- DecimalAnimationBase.cs
- CodeExpressionStatement.cs
- IncomingWebResponseContext.cs
- IndexedEnumerable.cs
- TransformationRules.cs
- Freezable.cs
- BrowserTree.cs
- CollaborationHelperFunctions.cs
- HtmlMeta.cs
- HashSet.cs
- Process.cs
- OdbcFactory.cs
- PropertyToken.cs
- UnsafeNativeMethods.cs
- RequestSecurityTokenResponse.cs
- DesignerActionPropertyItem.cs
- SessionStateContainer.cs
- Keyboard.cs
- latinshape.cs
- ConfigurationElementCollection.cs
- Int32Rect.cs
- RegexWriter.cs
- _UriTypeConverter.cs
- SafeLibraryHandle.cs
- WebPartVerbCollection.cs
- DrawingCollection.cs
- BitmapEffect.cs
- MailMessage.cs
- HMACSHA384.cs
- KeyInstance.cs
- FrameworkElementFactoryMarkupObject.cs
- XmlBindingWorker.cs
- RequestResizeEvent.cs
- ToggleButton.cs
- Soap12ProtocolReflector.cs
- TextSelection.cs
- Clock.cs
- XPathDocument.cs
- DataViewSettingCollection.cs
- NameValuePermission.cs
- CombinedHttpChannel.cs
- LineUtil.cs
- HtmlInputHidden.cs
- XslTransformFileEditor.cs
- XmlExpressionDumper.cs
- BindingUtils.cs
- RunWorkerCompletedEventArgs.cs
- DependsOnAttribute.cs
- EntityDataSourceQueryBuilder.cs
- CompilerResults.cs
- TextParentUndoUnit.cs
- EUCJPEncoding.cs
- WmlLinkAdapter.cs
- CheckBox.cs
- ConnectivityStatus.cs
- HierarchicalDataSourceIDConverter.cs
- ToolStripContentPanelRenderEventArgs.cs
- EncodingNLS.cs
- _SslStream.cs
- MissingSatelliteAssemblyException.cs
- UiaCoreTypesApi.cs
- XmlCDATASection.cs
- StructuredProperty.cs
- Filter.cs
- BufferedGraphicsManager.cs
- WebBrowserDocumentCompletedEventHandler.cs
- RequestCacheEntry.cs
- ConfigurationCollectionAttribute.cs
- SHA512.cs
- ChangeConflicts.cs
- DSASignatureFormatter.cs
- TrackingProvider.cs
- SQLConvert.cs
- SoapFormatter.cs
- AttributeEmitter.cs