Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //[....] //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StickyNoteAnnotations.cs
- XmlSecureResolver.cs
- InputManager.cs
- EncryptedReference.cs
- ModuleConfigurationInfo.cs
- XamlSerializationHelper.cs
- URI.cs
- FixedSOMElement.cs
- TrackBar.cs
- OdbcConnectionHandle.cs
- VectorAnimationBase.cs
- WorkflowRuntimeServiceElement.cs
- ObservableDictionary.cs
- ObjectDisposedException.cs
- NavigationService.cs
- ObjectStorage.cs
- InvalidCastException.cs
- Visual.cs
- WindowsFormsHostPropertyMap.cs
- EdmRelationshipRoleAttribute.cs
- DependencyPropertyAttribute.cs
- WindowsListView.cs
- ObjectCacheHost.cs
- EncodingDataItem.cs
- EditorPartCollection.cs
- SqlCacheDependencyDatabase.cs
- CodeValidator.cs
- TextProviderWrapper.cs
- DesignerActionVerbList.cs
- ApplyTemplatesAction.cs
- EmbeddedObject.cs
- DocumentReferenceCollection.cs
- FlowNode.cs
- FileChangesMonitor.cs
- Rect3D.cs
- ConstructorNeedsTagAttribute.cs
- WorkflowRuntimeBehavior.cs
- EvidenceTypeDescriptor.cs
- ManipulationStartedEventArgs.cs
- DataServiceHost.cs
- PrePrepareMethodAttribute.cs
- WindowsNonControl.cs
- TerminatorSinks.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- ScriptManagerProxy.cs
- GridProviderWrapper.cs
- CheckBoxPopupAdapter.cs
- StringComparer.cs
- WindowsGraphics.cs
- TextServicesLoader.cs
- MemberRelationshipService.cs
- SpeechSynthesizer.cs
- UserInitiatedNavigationPermission.cs
- Attribute.cs
- CookielessHelper.cs
- CommentEmitter.cs
- WebCategoryAttribute.cs
- ConnectionStringEditor.cs
- HyperLinkColumn.cs
- ClientRoleProvider.cs
- ScriptDescriptor.cs
- CqlErrorHelper.cs
- DataSourceXmlSerializationAttribute.cs
- AttributeData.cs
- QueryGenerator.cs
- PersonalizationState.cs
- XPathNavigatorException.cs
- UrlPropertyAttribute.cs
- PropertyGridEditorPart.cs
- HttpCacheParams.cs
- EntitySqlQueryCacheKey.cs
- ZoneLinkButton.cs
- Splitter.cs
- DataGridAutoFormatDialog.cs
- HTMLTagNameToTypeMapper.cs
- IDispatchConstantAttribute.cs
- XmlElementAttribute.cs
- Convert.cs
- DocumentGrid.cs
- HttpClientProtocol.cs
- ComPlusAuthorization.cs
- CacheForPrimitiveTypes.cs
- ContractMethodInfo.cs
- Utils.cs
- RequiredFieldValidator.cs
- Error.cs
- BamlTreeMap.cs
- SelectedGridItemChangedEvent.cs
- DataGrid.cs
- DataGridHeaderBorder.cs
- RenderData.cs
- HandleCollector.cs
- XmlSerializationWriter.cs
- TextStore.cs
- SelectedCellsCollection.cs
- SHA512Managed.cs
- TabOrder.cs
- TemplateKey.cs
- ThicknessConverter.cs
- SessionEndedEventArgs.cs