Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / schema / SchemaNamespaceManager.cs / 1305376 / 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
- XmlResolver.cs
- ServiceDebugBehavior.cs
- PolyLineSegment.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- LocalizedNameDescriptionPair.cs
- ResetableIterator.cs
- JumpPath.cs
- Renderer.cs
- PreloadedPackages.cs
- InstanceDataCollection.cs
- MbpInfo.cs
- BaseComponentEditor.cs
- RequiredAttributeAttribute.cs
- EmptyElement.cs
- CodeCastExpression.cs
- CatalogPartCollection.cs
- HostingEnvironmentException.cs
- ClosableStream.cs
- TriggerActionCollection.cs
- PenLineJoinValidation.cs
- AsymmetricSignatureDeformatter.cs
- SequenceRange.cs
- CodeBlockBuilder.cs
- HttpRuntime.cs
- PlanCompiler.cs
- fixedPageContentExtractor.cs
- DeviceContexts.cs
- DeferredBinaryDeserializerExtension.cs
- ScriptingProfileServiceSection.cs
- UIPermission.cs
- InteropAutomationProvider.cs
- SerializationInfoEnumerator.cs
- GenericAuthenticationEventArgs.cs
- FlatButtonAppearance.cs
- ToolStripDropDownButton.cs
- TraceRecord.cs
- ObjectView.cs
- BrowserDefinition.cs
- EmptyQuery.cs
- GridItemPatternIdentifiers.cs
- WorkflowClientDeliverMessageWrapper.cs
- KeyConverter.cs
- _SslStream.cs
- TextElement.cs
- WsatAdminException.cs
- PeerToPeerException.cs
- remotingproxy.cs
- HelloMessageApril2005.cs
- RowUpdatedEventArgs.cs
- SqlDataSourceQueryEditor.cs
- SiteMap.cs
- EnumValidator.cs
- MatrixCamera.cs
- WebPartUtil.cs
- SqlConnectionPoolGroupProviderInfo.cs
- _IPv4Address.cs
- Label.cs
- GridViewColumnCollection.cs
- RuntimeConfigLKG.cs
- InstanceStore.cs
- FormViewUpdatedEventArgs.cs
- ClaimSet.cs
- WebCategoryAttribute.cs
- OleDbParameter.cs
- LinkLabel.cs
- NativeWindow.cs
- StatusBarPanelClickEvent.cs
- CommandHelpers.cs
- RequestContext.cs
- BaseUriHelper.cs
- FormsAuthenticationModule.cs
- FloaterParagraph.cs
- XmlAggregates.cs
- DockPanel.cs
- _emptywebproxy.cs
- AutoGeneratedFieldProperties.cs
- BasePropertyDescriptor.cs
- DesignTable.cs
- CryptoKeySecurity.cs
- Switch.cs
- Set.cs
- UpdateProgress.cs
- X500Name.cs
- EntityPropertyMappingAttribute.cs
- PerfCounterSection.cs
- AttributeProviderAttribute.cs
- ActiveXHelper.cs
- DesignerCalendarAdapter.cs
- XamlLoadErrorInfo.cs
- SqlBinder.cs
- HwndAppCommandInputProvider.cs
- HMACMD5.cs
- PointAnimationUsingPath.cs
- ApplicationDirectoryMembershipCondition.cs
- RsaSecurityKey.cs
- ProxyHwnd.cs
- XmlSchemaInferenceException.cs
- LocalIdCollection.cs
- ConnectionsZone.cs
- ComponentSerializationService.cs