Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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
- UrlMappingsModule.cs
- TaskExtensions.cs
- OleDbError.cs
- RoleService.cs
- OutputCache.cs
- CompoundFileStreamReference.cs
- XamlWriter.cs
- ObjectDataSourceEventArgs.cs
- EnterpriseServicesHelper.cs
- BufferBuilder.cs
- DeclarationUpdate.cs
- TableFieldsEditor.cs
- Utilities.cs
- PointHitTestParameters.cs
- BinaryObjectInfo.cs
- VisualBasicReference.cs
- TypeReference.cs
- EntityClassGenerator.cs
- Pair.cs
- KeyBinding.cs
- _OSSOCK.cs
- ColumnReorderedEventArgs.cs
- SmiConnection.cs
- ProfileService.cs
- XsdDateTime.cs
- Itemizer.cs
- WorkflowRuntimeBehavior.cs
- OracleCommand.cs
- UserPreferenceChangingEventArgs.cs
- ClientOperationFormatterProvider.cs
- AnnotationComponentManager.cs
- QuaternionRotation3D.cs
- DataGridViewCellCancelEventArgs.cs
- TextContainerChangedEventArgs.cs
- WebConfigurationHost.cs
- HandlerBase.cs
- MethodCallExpression.cs
- PaintEvent.cs
- TextEditorSelection.cs
- PropertyOverridesTypeEditor.cs
- FixedHighlight.cs
- formatter.cs
- SchemaConstraints.cs
- FtpWebRequest.cs
- ExecutedRoutedEventArgs.cs
- versioninfo.cs
- VersionPair.cs
- MembershipPasswordException.cs
- BinaryNegotiation.cs
- Stack.cs
- XmlIgnoreAttribute.cs
- CaretElement.cs
- DataTableNewRowEvent.cs
- Section.cs
- Stylesheet.cs
- CodeDomExtensionMethods.cs
- TransformPattern.cs
- Win32.cs
- BitmapCodecInfoInternal.cs
- FileSystemWatcher.cs
- OleDbParameterCollection.cs
- InputScope.cs
- DataServiceQueryProvider.cs
- Win32.cs
- DataGridCellInfo.cs
- GetWinFXPath.cs
- PageContentCollection.cs
- FrameworkElementAutomationPeer.cs
- StructuralType.cs
- ZoneIdentityPermission.cs
- MergePropertyDescriptor.cs
- EntityDataSourceDataSelection.cs
- WS2007FederationHttpBindingElement.cs
- InternalBase.cs
- SqlCaseSimplifier.cs
- NavigationFailedEventArgs.cs
- ValidationSettings.cs
- ToolStripPanelDesigner.cs
- ContextMenuService.cs
- XmlDataLoader.cs
- InfoCardSymmetricCrypto.cs
- DiscoveryInnerClientManaged11.cs
- ListDictionaryInternal.cs
- NumericPagerField.cs
- CompModSwitches.cs
- SynchronizationFilter.cs
- ClockGroup.cs
- X509Utils.cs
- EntitySqlQueryBuilder.cs
- OleDbPermission.cs
- ToolstripProfessionalRenderer.cs
- EntityCollection.cs
- SecurityElement.cs
- Task.cs
- ControlIdConverter.cs
- Privilege.cs
- SortDescriptionCollection.cs
- FirstMatchCodeGroup.cs
- XmlName.cs
- NativeMethods.cs