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
- InitializationEventAttribute.cs
- ChangeInterceptorAttribute.cs
- DataPointer.cs
- FocusTracker.cs
- Double.cs
- SystemFonts.cs
- HandlerWithFactory.cs
- FormParameter.cs
- TypeNameConverter.cs
- TouchesOverProperty.cs
- ZipIOLocalFileBlock.cs
- compensatingcollection.cs
- CustomErrorsSection.cs
- SortDescriptionCollection.cs
- FormCollection.cs
- SessionStateSection.cs
- CounterCreationData.cs
- DataSourceUtil.cs
- ValueTypeFixupInfo.cs
- DbProviderSpecificTypePropertyAttribute.cs
- StickyNote.cs
- DataBindingHandlerAttribute.cs
- CatalogPartCollection.cs
- Queue.cs
- ArgumentOutOfRangeException.cs
- Margins.cs
- Parameter.cs
- ReflectionServiceProvider.cs
- DbParameterCollection.cs
- XmlSchemaDatatype.cs
- InputLanguageProfileNotifySink.cs
- LogicalChannel.cs
- HttpPostProtocolImporter.cs
- Bookmark.cs
- ArraySortHelper.cs
- SafeFileMapViewHandle.cs
- QueueProcessor.cs
- CmsInterop.cs
- QueryReaderSettings.cs
- CheckableControlBaseAdapter.cs
- SQLSingle.cs
- Sentence.cs
- XPathDocumentIterator.cs
- DateTimeUtil.cs
- VirtualizingPanel.cs
- WindowsFormsHelpers.cs
- isolationinterop.cs
- RectValueSerializer.cs
- HttpListenerPrefixCollection.cs
- SQLInt32Storage.cs
- FormClosedEvent.cs
- UpdateProgress.cs
- SyntaxCheck.cs
- Claim.cs
- ResXBuildProvider.cs
- HttpException.cs
- ImageConverter.cs
- OperatingSystem.cs
- CorePropertiesFilter.cs
- WmlValidationSummaryAdapter.cs
- LinearGradientBrush.cs
- TableLayoutPanel.cs
- ToolStripSeparatorRenderEventArgs.cs
- RSACryptoServiceProvider.cs
- DataList.cs
- ConfigurationValidatorBase.cs
- GridErrorDlg.cs
- SQlBooleanStorage.cs
- TemplateManager.cs
- HttpWrapper.cs
- Compiler.cs
- EditorPartCollection.cs
- SqlRowUpdatedEvent.cs
- DataGridViewColumnHeaderCell.cs
- ReachFixedPageSerializerAsync.cs
- LocalizeDesigner.cs
- XmlSchemaAttribute.cs
- UnauthorizedWebPart.cs
- HttpConfigurationSystem.cs
- ResourcesChangeInfo.cs
- WsdlInspector.cs
- XmlSerializationWriter.cs
- ConstraintEnumerator.cs
- XPathParser.cs
- RpcAsyncResult.cs
- _ProxyRegBlob.cs
- XmlBinaryReader.cs
- BinaryExpression.cs
- CheckBoxBaseAdapter.cs
- DelegateBodyWriter.cs
- XmlNodeChangedEventArgs.cs
- TextEndOfSegment.cs
- LocalizationComments.cs
- HttpDictionary.cs
- DataGridViewDesigner.cs
- ResourceProviderFactory.cs
- TextTreeExtractElementUndoUnit.cs
- WorkItem.cs
- Point3DValueSerializer.cs
- ActivityMarkupSerializer.cs