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
- BaseDataListPage.cs
- DocumentOrderQuery.cs
- CategoryGridEntry.cs
- CheckBoxFlatAdapter.cs
- XMLDiffLoader.cs
- FloaterParagraph.cs
- WindowHideOrCloseTracker.cs
- WizardPanel.cs
- RandomNumberGenerator.cs
- ConnectionManagementElement.cs
- TransportConfigurationTypeElementCollection.cs
- PtsPage.cs
- WinFormsSpinner.cs
- SelectionUIService.cs
- IntSecurity.cs
- FileEnumerator.cs
- RichTextBox.cs
- AuthenticationService.cs
- VisualCollection.cs
- Formatter.cs
- KnownTypes.cs
- HitTestWithPointDrawingContextWalker.cs
- ComboBoxRenderer.cs
- Component.cs
- MethodCallConverter.cs
- MediaContext.cs
- PolicyFactory.cs
- DbSourceCommand.cs
- EntityDataSourceContainerNameItem.cs
- Enlistment.cs
- MetadataItemCollectionFactory.cs
- CollectionBuilder.cs
- WsatServiceCertificate.cs
- SecurityHelper.cs
- PartitionerQueryOperator.cs
- XmlDigitalSignatureProcessor.cs
- TypeSystem.cs
- QueryStringParameter.cs
- DataGridItem.cs
- FontStyleConverter.cs
- PersistChildrenAttribute.cs
- MimeObjectFactory.cs
- SimpleType.cs
- oledbconnectionstring.cs
- WebServiceClientProxyGenerator.cs
- IndependentAnimationStorage.cs
- XmlSchemaAll.cs
- SeparatorAutomationPeer.cs
- VectorKeyFrameCollection.cs
- Main.cs
- SqlConnectionFactory.cs
- DependencyObjectType.cs
- ObjectViewFactory.cs
- TextRangeAdaptor.cs
- ControlPager.cs
- __FastResourceComparer.cs
- ProcessMessagesAsyncResult.cs
- DataMisalignedException.cs
- SubclassTypeValidatorAttribute.cs
- MailMessageEventArgs.cs
- StreamGeometryContext.cs
- Cursors.cs
- FakeModelPropertyImpl.cs
- GeometryConverter.cs
- AuditLevel.cs
- FormView.cs
- FilterUserControlBase.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- PersonalizablePropertyEntry.cs
- SizeAnimationBase.cs
- StorageInfo.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- FreezableDefaultValueFactory.cs
- XPathSelfQuery.cs
- FormatterConverter.cs
- WebServiceClientProxyGenerator.cs
- VirtualizedContainerService.cs
- SimpleWebHandlerParser.cs
- EmptyEnumerator.cs
- Duration.cs
- SelectionPatternIdentifiers.cs
- ContainerUtilities.cs
- DateTimeConstantAttribute.cs
- WebHttpSecurityElement.cs
- WebPartCollection.cs
- NotifyParentPropertyAttribute.cs
- ToolboxBitmapAttribute.cs
- XamlReader.cs
- ChangeNode.cs
- ProviderUtil.cs
- TypedReference.cs
- XmlSiteMapProvider.cs
- DetailsView.cs
- ErrorWebPart.cs
- LiteralTextContainerControlBuilder.cs
- Serializer.cs
- DataPagerFieldItem.cs
- WorkflowMarkupSerializerMapping.cs
- EncodingNLS.cs
- OutputScopeManager.cs