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
- ListViewItemMouseHoverEvent.cs
- FileSystemInfo.cs
- Point4D.cs
- AppDomainProtocolHandler.cs
- StorageScalarPropertyMapping.cs
- CapabilitiesUse.cs
- ServicePointManagerElement.cs
- DBPropSet.cs
- DeploymentExceptionMapper.cs
- XamlSerializationHelper.cs
- XmlSchemaSequence.cs
- webeventbuffer.cs
- pingexception.cs
- ObjectStateManager.cs
- Figure.cs
- SQLString.cs
- MappingException.cs
- KnownAssembliesSet.cs
- UInt16.cs
- TailCallAnalyzer.cs
- ToolStripDropDownMenu.cs
- ConditionalDesigner.cs
- GradientStop.cs
- NativeMethods.cs
- WorkflowMarkupSerializer.cs
- CryptoConfig.cs
- BaseResourcesBuildProvider.cs
- Claim.cs
- WebServicesSection.cs
- ScrollViewer.cs
- DesigntimeLicenseContext.cs
- SqlDataSourceCache.cs
- CroppedBitmap.cs
- HttpCacheVaryByContentEncodings.cs
- BamlResourceSerializer.cs
- Button.cs
- ObjectView.cs
- XPathAncestorQuery.cs
- StylusButtonCollection.cs
- RawUIStateInputReport.cs
- DoubleConverter.cs
- WebEventCodes.cs
- SettingsBindableAttribute.cs
- InstancePersistenceEvent.cs
- WebErrorHandler.cs
- RunInstallerAttribute.cs
- ObjectConverter.cs
- CodeSnippetStatement.cs
- HyperLink.cs
- DBSqlParserTable.cs
- SHA384.cs
- HierarchicalDataTemplate.cs
- RequestBringIntoViewEventArgs.cs
- ListItemCollection.cs
- EventRoute.cs
- CodeBinaryOperatorExpression.cs
- CLSCompliantAttribute.cs
- IndexerNameAttribute.cs
- MethodBody.cs
- HostingEnvironment.cs
- StandardOleMarshalObject.cs
- TreeBuilder.cs
- SiteMap.cs
- UrlEncodedParameterWriter.cs
- QueryAccessibilityHelpEvent.cs
- ProxyGenerationError.cs
- CatalogPartChrome.cs
- StorageFunctionMapping.cs
- ActiveXSite.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- OneOf.cs
- EntityContainerRelationshipSetEnd.cs
- HotSpotCollection.cs
- DnsPermission.cs
- BitmapMetadataBlob.cs
- SoapSchemaImporter.cs
- ConsumerConnectionPoint.cs
- UInt16Storage.cs
- InstanceNormalEvent.cs
- PropertyFilterAttribute.cs
- AxImporter.cs
- ReadOnlyDictionary.cs
- Margins.cs
- XamlSerializerUtil.cs
- XmlWrappingWriter.cs
- EntityWrapper.cs
- Type.cs
- ResourceAssociationType.cs
- AddInServer.cs
- InputScopeManager.cs
- HelpInfo.cs
- _CacheStreams.cs
- SimpleLine.cs
- ByteStorage.cs
- EntitySetBaseCollection.cs
- ExeContext.cs
- WebPartMovingEventArgs.cs
- GlobalEventManager.cs
- BasicViewGenerator.cs
- XmlnsCache.cs