Code:
/ DotNET / DotNET / 8.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
- TextWriterEngine.cs
- MessageSecurityTokenVersion.cs
- SynchronizedInputProviderWrapper.cs
- DiagnosticTraceRecords.cs
- ProfilePropertySettingsCollection.cs
- DataGridPagingPage.cs
- MergeLocalizationDirectives.cs
- ScalarRestriction.cs
- UrlPath.cs
- DataMemberListEditor.cs
- X509Certificate2Collection.cs
- ExchangeUtilities.cs
- __ConsoleStream.cs
- XpsS0ValidatingLoader.cs
- DES.cs
- SecurityPolicySection.cs
- SerializationObjectManager.cs
- DataViewSetting.cs
- XmlTextEncoder.cs
- TextDecorationCollection.cs
- ZipIORawDataFileBlock.cs
- DateTimeParse.cs
- StagingAreaInputItem.cs
- PageStatePersister.cs
- X509ThumbprintKeyIdentifierClause.cs
- SqlDataSourceRefreshSchemaForm.cs
- MessageQueueConverter.cs
- SafeViewOfFileHandle.cs
- OptionalColumn.cs
- AtomicFile.cs
- MultiView.cs
- ContainerUtilities.cs
- GenericTypeParameterBuilder.cs
- DecimalMinMaxAggregationOperator.cs
- XmlWrappingReader.cs
- HierarchicalDataSourceControl.cs
- DispatcherFrame.cs
- GlobalItem.cs
- SchemaManager.cs
- EditorZone.cs
- CodeStatement.cs
- CodeTypeReferenceCollection.cs
- KeyProperty.cs
- WindowsFormsLinkLabel.cs
- RegexCharClass.cs
- ECDiffieHellmanPublicKey.cs
- IRCollection.cs
- CorruptingExceptionCommon.cs
- XmlILModule.cs
- Rect3D.cs
- BypassElementCollection.cs
- ServiceDeploymentInfo.cs
- _SslState.cs
- UrlAuthFailedErrorFormatter.cs
- TreeViewItemAutomationPeer.cs
- Rules.cs
- VisualStates.cs
- StrokeCollection.cs
- WebReferencesBuildProvider.cs
- AbandonedMutexException.cs
- MenuItem.cs
- WCFServiceClientProxyGenerator.cs
- HyperLinkField.cs
- BindToObject.cs
- PropertyMapper.cs
- RangeValuePattern.cs
- CapabilitiesAssignment.cs
- WebColorConverter.cs
- WCFModelStrings.Designer.cs
- ElementUtil.cs
- DynamicDocumentPaginator.cs
- MouseOverProperty.cs
- StatusInfoItem.cs
- XmlCountingReader.cs
- PowerModeChangedEventArgs.cs
- ActivationServices.cs
- TemplateGroupCollection.cs
- LoginName.cs
- UnknownWrapper.cs
- TableNameAttribute.cs
- DataGridViewCellMouseEventArgs.cs
- DriveNotFoundException.cs
- CachedFontFamily.cs
- RichTextBoxAutomationPeer.cs
- RelativeSource.cs
- HttpWebResponse.cs
- UnitySerializationHolder.cs
- InputScopeAttribute.cs
- SQLInt16.cs
- CharacterString.cs
- ParserContext.cs
- HtmlControlPersistable.cs
- MetafileHeaderEmf.cs
- ListSortDescriptionCollection.cs
- Converter.cs
- HTTPNotFoundHandler.cs
- Int64Storage.cs
- Events.cs
- WebPartTransformerCollection.cs
- DetailsViewInsertedEventArgs.cs