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
- TemplateContentLoader.cs
- ConfigurationManager.cs
- ListBox.cs
- ZipIOExtraField.cs
- Site.cs
- ReadOnlyDataSource.cs
- MediaPlayerState.cs
- WhitespaceRuleReader.cs
- InputLanguageCollection.cs
- ModelTreeEnumerator.cs
- DispatcherOperation.cs
- RangeValuePatternIdentifiers.cs
- HandleRef.cs
- path.cs
- OdbcHandle.cs
- WFItemsToSpacerVisibility.cs
- PackageRelationship.cs
- CommonDialog.cs
- SQLCharsStorage.cs
- XmlnsDefinitionAttribute.cs
- WmlPanelAdapter.cs
- Label.cs
- GlyphInfoList.cs
- CriticalHandle.cs
- HttpInputStream.cs
- MessageEncoderFactory.cs
- Animatable.cs
- EmptyEnumerable.cs
- InputLanguageSource.cs
- ParseChildrenAsPropertiesAttribute.cs
- PropertyDescriptorCollection.cs
- PackageRelationship.cs
- MediaContextNotificationWindow.cs
- CompoundFileDeflateTransform.cs
- UnitySerializationHolder.cs
- XmlNode.cs
- DataGridViewSelectedCellCollection.cs
- DataConnectionHelper.cs
- UnsafeNativeMethods.cs
- DynamicDocumentPaginator.cs
- TextTreeRootNode.cs
- PersistenceMetadataNamespace.cs
- InternalConfigEventArgs.cs
- QilReplaceVisitor.cs
- AuthenticationModuleElement.cs
- StorageComplexTypeMapping.cs
- InheritanceContextChangedEventManager.cs
- UpdateCompiler.cs
- RelationshipDetailsRow.cs
- ReturnEventArgs.cs
- PermissionListSet.cs
- RequestDescription.cs
- RegistryConfigurationProvider.cs
- WorkflowPageSetupDialog.cs
- URL.cs
- GroupByExpressionRewriter.cs
- CompiledQueryCacheEntry.cs
- ToolStrip.cs
- InternalsVisibleToAttribute.cs
- WorkflowDesignerMessageFilter.cs
- AuthenticateEventArgs.cs
- KeySpline.cs
- HTMLTagNameToTypeMapper.cs
- DynamicObjectAccessor.cs
- Drawing.cs
- OutgoingWebRequestContext.cs
- OutputCache.cs
- DataControlFieldCell.cs
- MarshalByValueComponent.cs
- XmlDataCollection.cs
- AutoGeneratedField.cs
- RuntimeEnvironment.cs
- WinInet.cs
- HelpInfo.cs
- ItemCheckedEvent.cs
- MiniConstructorInfo.cs
- LineMetrics.cs
- WindowsListViewScroll.cs
- SizeConverter.cs
- DesignerLabelAdapter.cs
- MenuAutomationPeer.cs
- Transform3DGroup.cs
- StylusPoint.cs
- ErasingStroke.cs
- MimeTypeMapper.cs
- DataGridHelper.cs
- BmpBitmapEncoder.cs
- SelectionRangeConverter.cs
- CodeTypeReference.cs
- ResXBuildProvider.cs
- XmlUtil.cs
- SparseMemoryStream.cs
- DataBindEngine.cs
- EdmMember.cs
- CompletedAsyncResult.cs
- ScriptBehaviorDescriptor.cs
- WorkflowServiceAttributesTypeConverter.cs
- BaseComponentEditor.cs
- ComponentSerializationService.cs
- PropertyOverridesTypeEditor.cs