Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / Xml / System / Xml / schema / SchemaNamespaceManager.cs / 1 / SchemaNamespaceManager.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Schema { using System; using System.Diagnostics; using System.Collections; internal class SchemaNamespaceManager : XmlNamespaceManager { XmlSchemaObject node; public SchemaNamespaceManager(XmlSchemaObject node) { this.node = node; } public override string LookupNamespace(string prefix) { if (prefix == "xml") { //Special case for the XML namespace return XmlReservedNs.NsXml; } Hashtable namespaces; for (XmlSchemaObject current = node; current != null; current = current.Parent) { namespaces = current.Namespaces.Namespaces; if (namespaces != null && namespaces.Count > 0) { object uri = namespaces[prefix]; if (uri != null) return (string)uri; } } return prefix.Length == 0 ? string.Empty : null; } public override string LookupPrefix(string ns) { if (ns == XmlReservedNs.NsXml) { //Special case for the XML namespace return "xml"; } Hashtable namespaces; for (XmlSchemaObject current = node; current != null; current = current.Parent) { namespaces = current.Namespaces.Namespaces; if (namespaces != null && namespaces.Count > 0) { foreach(DictionaryEntry entry in namespaces) { if (entry.Value.Equals(ns)) { return (string)entry.Key; } } } } return null; } }; //SchemaNamespaceManager } // 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
- DomainUpDown.cs
- ResourceDescriptionAttribute.cs
- _ChunkParse.cs
- MessageSecurityProtocol.cs
- ScalarOps.cs
- XmlSortKey.cs
- CodeDomSerializationProvider.cs
- ContentFileHelper.cs
- Label.cs
- DrawingImage.cs
- ConfigurationManagerInternalFactory.cs
- DocumentOrderQuery.cs
- AsymmetricSignatureFormatter.cs
- PackageDigitalSignature.cs
- ServiceNameElement.cs
- TakeOrSkipQueryOperator.cs
- WizardForm.cs
- AppDomainAttributes.cs
- BooleanKeyFrameCollection.cs
- SqlColumnizer.cs
- BaseValidator.cs
- SqlReorderer.cs
- ClientTargetCollection.cs
- ProfileBuildProvider.cs
- InitializingNewItemEventArgs.cs
- CodeDelegateInvokeExpression.cs
- WebBrowserSiteBase.cs
- CapabilitiesSection.cs
- QilTernary.cs
- HotSpot.cs
- PopupEventArgs.cs
- ListenDesigner.cs
- GregorianCalendar.cs
- PropertyChangedEventManager.cs
- Common.cs
- SHA512CryptoServiceProvider.cs
- PrintDocument.cs
- Memoizer.cs
- DataGridViewUtilities.cs
- ProfessionalColorTable.cs
- Int16AnimationUsingKeyFrames.cs
- TextTreeNode.cs
- SchemaNames.cs
- SpellerStatusTable.cs
- ActivityTrace.cs
- LineInfo.cs
- MimeObjectFactory.cs
- BlobPersonalizationState.cs
- Int32Animation.cs
- HttpHandlerAction.cs
- BuildResult.cs
- FileIOPermission.cs
- ObjectDataProvider.cs
- AcceleratedTokenProviderState.cs
- AspNetPartialTrustHelpers.cs
- TextPattern.cs
- KnownBoxes.cs
- OletxEnlistment.cs
- LinearKeyFrames.cs
- dataprotectionpermission.cs
- SetUserPreferenceRequest.cs
- ConfigurationSection.cs
- RowVisual.cs
- Page.cs
- Keyboard.cs
- PermissionAttributes.cs
- WebUtil.cs
- DataFormats.cs
- EnvironmentPermission.cs
- SiteMapNodeItem.cs
- ParameterModifier.cs
- DuplicateContext.cs
- FrugalMap.cs
- Substitution.cs
- CodePageUtils.cs
- TextTreeNode.cs
- SoapExtensionTypeElementCollection.cs
- MD5CryptoServiceProvider.cs
- OleDbReferenceCollection.cs
- externdll.cs
- ComboBoxItem.cs
- RequestCachingSection.cs
- Clock.cs
- Transform.cs
- AttributeUsageAttribute.cs
- AssemblyResourceLoader.cs
- validationstate.cs
- XmlSchemaElement.cs
- CompatibleIComparer.cs
- ThousandthOfEmRealDoubles.cs
- IndicShape.cs
- EncodingNLS.cs
- PropertyGridCommands.cs
- FileVersionInfo.cs
- SettingsPropertyIsReadOnlyException.cs
- CodeStatementCollection.cs
- ValueProviderWrapper.cs
- XmlRootAttribute.cs
- MultiTargetingUtil.cs
- ImplicitInputBrush.cs