Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ResourcePool.cs
- ModifyActivitiesPropertyDescriptor.cs
- TextRunProperties.cs
- DbSetClause.cs
- _NegoState.cs
- HttpStaticObjectsCollectionWrapper.cs
- DateTimeConverter.cs
- SeverityFilter.cs
- WindowsFormsSynchronizationContext.cs
- MenuItemStyle.cs
- CodeEventReferenceExpression.cs
- DataObject.cs
- TextTreeFixupNode.cs
- Grid.cs
- ComplexObject.cs
- TabControlAutomationPeer.cs
- VectorAnimation.cs
- ChannelServices.cs
- DataGridViewImageColumn.cs
- Hashtable.cs
- TraceUtils.cs
- CodeEntryPointMethod.cs
- unsafenativemethodsother.cs
- InstanceNameConverter.cs
- SoapInteropTypes.cs
- Utils.cs
- CorrelationManager.cs
- XamlSerializerUtil.cs
- RemoteCryptoDecryptRequest.cs
- BindingExpression.cs
- PageSettings.cs
- WindowsRichEdit.cs
- WSHttpSecurity.cs
- PublisherIdentityPermission.cs
- ImplicitInputBrush.cs
- UnicastIPAddressInformationCollection.cs
- Pens.cs
- SafeFindHandle.cs
- SqlDataSourceStatusEventArgs.cs
- SourceFileInfo.cs
- ExpressionBindingCollection.cs
- WebPartConnectionsDisconnectVerb.cs
- SeparatorAutomationPeer.cs
- DataStorage.cs
- ServiceBehaviorAttribute.cs
- PointF.cs
- PathTooLongException.cs
- LinqMaximalSubtreeNominator.cs
- Menu.cs
- Menu.cs
- SortKey.cs
- DictationGrammar.cs
- DataGridCheckBoxColumn.cs
- LongSumAggregationOperator.cs
- ProgressiveCrcCalculatingStream.cs
- OledbConnectionStringbuilder.cs
- SponsorHelper.cs
- RuntimeWrappedException.cs
- HostExecutionContextManager.cs
- OracleInternalConnection.cs
- InputScopeAttribute.cs
- TraceListeners.cs
- Variant.cs
- XmlComplianceUtil.cs
- cookieexception.cs
- WebServiceClientProxyGenerator.cs
- DirectoryObjectSecurity.cs
- CustomErrorCollection.cs
- EventBuilder.cs
- BeginEvent.cs
- DynamicDiscoSearcher.cs
- PlanCompiler.cs
- TabPage.cs
- DataViewManagerListItemTypeDescriptor.cs
- SoapEnumAttribute.cs
- Condition.cs
- SecurityTokenInclusionMode.cs
- TrustManagerMoreInformation.cs
- Thread.cs
- MembershipPasswordException.cs
- ProcessRequestArgs.cs
- IteratorFilter.cs
- TreeNode.cs
- StateBag.cs
- XmlSchemaImporter.cs
- AddingNewEventArgs.cs
- CalendarItem.cs
- UnsafeNativeMethods.cs
- DistributedTransactionPermission.cs
- SqlXml.cs
- BaseResourcesBuildProvider.cs
- BCLDebug.cs
- IntSecurity.cs
- altserialization.cs
- FlowLayout.cs
- SiteMapDataSourceView.cs
- Int64Animation.cs
- ActivityInterfaces.cs
- XmlIlGenerator.cs
- SqlMethods.cs