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
- COM2ColorConverter.cs
- FixedPage.cs
- DbParameterHelper.cs
- TextFindEngine.cs
- LocalizedNameDescriptionPair.cs
- DigestComparer.cs
- UiaCoreProviderApi.cs
- RowUpdatingEventArgs.cs
- OLEDB_Util.cs
- XmlBinaryWriterSession.cs
- ListBox.cs
- FileLevelControlBuilderAttribute.cs
- ProtectedConfigurationSection.cs
- ResourceContainer.cs
- ISFClipboardData.cs
- ReadOnlyPropertyMetadata.cs
- XmlChoiceIdentifierAttribute.cs
- ListItemCollection.cs
- DecoderBestFitFallback.cs
- WindowsGraphics.cs
- ScriptReference.cs
- DrawingAttributesDefaultValueFactory.cs
- ListViewTableRow.cs
- ToolStripOverflow.cs
- FixedSOMImage.cs
- CloseSequence.cs
- SimpleTypeResolver.cs
- VirtualPath.cs
- PieceDirectory.cs
- COM2ColorConverter.cs
- RootBrowserWindowAutomationPeer.cs
- ShaderEffect.cs
- HttpCacheParams.cs
- RequestQueryProcessor.cs
- PageSetupDialog.cs
- Rectangle.cs
- RegularExpressionValidator.cs
- ResourceReader.cs
- ValidationHelper.cs
- DataIdProcessor.cs
- TypeSystem.cs
- ClonableStack.cs
- UIElementIsland.cs
- ObjectListCommandCollection.cs
- RawStylusInputCustomDataList.cs
- WindowsSlider.cs
- TypeSemantics.cs
- UIPropertyMetadata.cs
- MediaPlayer.cs
- Vector3DAnimationBase.cs
- IChannel.cs
- SqlVisitor.cs
- SqlDataSourceDesigner.cs
- base64Transforms.cs
- NullableDoubleMinMaxAggregationOperator.cs
- Soap.cs
- WhereaboutsReader.cs
- DataSourceXmlAttributeAttribute.cs
- SyndicationLink.cs
- Control.cs
- Point4DValueSerializer.cs
- Axis.cs
- TaskScheduler.cs
- ConnectionStringsExpressionBuilder.cs
- AsyncContentLoadedEventArgs.cs
- TimeSpanSecondsConverter.cs
- ExpressionCopier.cs
- BaseProcessor.cs
- ExpressionVisitor.cs
- ReflectionHelper.cs
- TextContainerChangeEventArgs.cs
- SettingsPropertyNotFoundException.cs
- UrlMappingsModule.cs
- QuaternionAnimationUsingKeyFrames.cs
- SessionStateSection.cs
- DefaultPrintController.cs
- SRGSCompiler.cs
- brushes.cs
- ClientFormsAuthenticationCredentials.cs
- JournalNavigationScope.cs
- TypeContext.cs
- OciEnlistContext.cs
- XmlCompatibilityReader.cs
- DesignerTextViewAdapter.cs
- ActivityMarkupSerializationProvider.cs
- MultipleViewPattern.cs
- EndOfStreamException.cs
- Column.cs
- WebPartConnectionsConfigureVerb.cs
- SoapAttributes.cs
- UIElementAutomationPeer.cs
- Literal.cs
- MarshalByRefObject.cs
- CryptoApi.cs
- CfgParser.cs
- IssuanceTokenProviderBase.cs
- SqlUnionizer.cs
- DataGridColumn.cs
- FilterQuery.cs
- Size3D.cs