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
- nulltextnavigator.cs
- DoubleLinkListEnumerator.cs
- ModuleBuilder.cs
- HttpPostedFile.cs
- Point3DCollection.cs
- SchemaConstraints.cs
- FixedSOMTableRow.cs
- _NTAuthentication.cs
- DesignOnlyAttribute.cs
- MemberDescriptor.cs
- SplitterCancelEvent.cs
- ConfigDefinitionUpdates.cs
- MergeFailedEvent.cs
- HyperLinkField.cs
- ClientData.cs
- FlowPanelDesigner.cs
- DocumentPageTextView.cs
- shaper.cs
- EmbeddedObject.cs
- SafePEFileHandle.cs
- TypeInfo.cs
- HwndKeyboardInputProvider.cs
- DesignTimeTemplateParser.cs
- PageOrientation.cs
- XmlSchemaCompilationSettings.cs
- AutomationProperty.cs
- TargetControlTypeAttribute.cs
- DataGridViewCellParsingEventArgs.cs
- SaveFileDialog.cs
- Message.cs
- RestHandler.cs
- TextEditorSelection.cs
- ArgIterator.cs
- BitStack.cs
- FileDialogCustomPlaces.cs
- SymbolTable.cs
- ConstantProjectedSlot.cs
- HttpApplicationFactory.cs
- SafeEventLogWriteHandle.cs
- VScrollProperties.cs
- LoadedEvent.cs
- HighlightVisual.cs
- MemoryMappedView.cs
- DriveInfo.cs
- ExpressionVisitor.cs
- CodeGenerator.cs
- ForEach.cs
- SessionStateItemCollection.cs
- HitTestWithPointDrawingContextWalker.cs
- SoapRpcServiceAttribute.cs
- SchemaEntity.cs
- ParserHooks.cs
- LayoutTable.cs
- AppliedDeviceFiltersEditor.cs
- ObjectItemCollection.cs
- LinqDataSourceValidationException.cs
- Types.cs
- ReadOnlyDictionary.cs
- XmlSchemaExternal.cs
- JobInputBins.cs
- FilterableAttribute.cs
- DataGridViewRowCollection.cs
- Win32Native.cs
- InternalDispatchObject.cs
- OutputCacheProfile.cs
- CounterCreationDataCollection.cs
- WebPartsPersonalizationAuthorization.cs
- WriteTimeStream.cs
- PrimitiveXmlSerializers.cs
- CqlErrorHelper.cs
- IdentityReference.cs
- ValidationHelpers.cs
- GlyphsSerializer.cs
- Stacktrace.cs
- Int32CollectionValueSerializer.cs
- MatrixTransform.cs
- InternalBase.cs
- MobileContainerDesigner.cs
- SiteMapPathDesigner.cs
- LayoutTable.cs
- ImageSource.cs
- XamlParser.cs
- FlowLayoutPanelDesigner.cs
- HostProtectionPermission.cs
- safePerfProviderHandle.cs
- _ProxyRegBlob.cs
- XmlAtomicValue.cs
- XamlTypeMapper.cs
- KeyGestureValueSerializer.cs
- XmlSerializerAssemblyAttribute.cs
- TemplateXamlParser.cs
- FrugalList.cs
- SchemaNotation.cs
- DecimalAnimationUsingKeyFrames.cs
- Style.cs
- InternalDispatchObject.cs
- RolePrincipal.cs
- ValidatorUtils.cs
- SoapParser.cs
- TemplateDefinition.cs