Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- contentDescriptor.cs
- RadioButtonPopupAdapter.cs
- UncommonField.cs
- ContentElement.cs
- Header.cs
- ControlUtil.cs
- UpDownBase.cs
- Latin1Encoding.cs
- PolyBezierSegmentFigureLogic.cs
- Int64Storage.cs
- RepeatButtonAutomationPeer.cs
- CookielessHelper.cs
- ModelTreeEnumerator.cs
- ServiceModelStringsVersion1.cs
- GeneralTransform2DTo3D.cs
- AttributeInfo.cs
- ListViewAutomationPeer.cs
- XMLDiffLoader.cs
- DPTypeDescriptorContext.cs
- BaseValidator.cs
- PingReply.cs
- SiteMapDataSourceView.cs
- WebResponse.cs
- SiblingIterators.cs
- PtsHost.cs
- AssemblyBuilder.cs
- ApplicationSecurityManager.cs
- CodeTypeParameter.cs
- TreeNodeBindingCollection.cs
- SqlInternalConnectionTds.cs
- ProvidersHelper.cs
- ProfileSection.cs
- WindowsAuthenticationEventArgs.cs
- _NegoState.cs
- MouseGestureConverter.cs
- WebBrowser.cs
- WindowsButton.cs
- LeftCellWrapper.cs
- DiffuseMaterial.cs
- UnregisterInfo.cs
- EntityDataSourceChangingEventArgs.cs
- IOThreadTimer.cs
- DocumentManager.cs
- ScriptReference.cs
- CodeTryCatchFinallyStatement.cs
- BrowserCapabilitiesCodeGenerator.cs
- NegotiateStream.cs
- PathFigure.cs
- MessageQueueCriteria.cs
- CodeIdentifiers.cs
- Debug.cs
- DataGridLinkButton.cs
- RijndaelManagedTransform.cs
- DataGridColumnHeadersPresenter.cs
- _Win32.cs
- XmlKeywords.cs
- AbstractExpressions.cs
- TabPageDesigner.cs
- ReachVisualSerializerAsync.cs
- Light.cs
- CreateUserWizardStep.cs
- GetPageNumberCompletedEventArgs.cs
- UnsafeNativeMethods.cs
- DuplicateWaitObjectException.cs
- SerialPinChanges.cs
- XmlSchemaProviderAttribute.cs
- Context.cs
- RegexCompiler.cs
- JournalEntry.cs
- SettingsPropertyCollection.cs
- SslSecurityTokenParameters.cs
- KeyConstraint.cs
- PaintEvent.cs
- DisableDpiAwarenessAttribute.cs
- _NegoStream.cs
- InvalidAsynchronousStateException.cs
- DATA_BLOB.cs
- PartialCachingAttribute.cs
- Coordinator.cs
- followingsibling.cs
- ElementProxy.cs
- LowerCaseStringConverter.cs
- XmlNavigatorStack.cs
- HeaderedItemsControl.cs
- TableNameAttribute.cs
- GlyphInfoList.cs
- WebPartConnectionsConfigureVerb.cs
- SemanticBasicElement.cs
- WebPartHeaderCloseVerb.cs
- AsynchronousChannel.cs
- BufferedStream.cs
- ProcessModuleDesigner.cs
- ControlEvent.cs
- DataSourceCacheDurationConverter.cs
- MetadataUtil.cs
- SrgsElementList.cs
- URLMembershipCondition.cs
- AdRotator.cs
- InvariantComparer.cs
- COM2ICategorizePropertiesHandler.cs