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
- InvokeDelegate.cs
- BuilderPropertyEntry.cs
- PrivateFontCollection.cs
- SqlConnectionString.cs
- ManagementObject.cs
- DefaultShape.cs
- ObjectTag.cs
- updatecommandorderer.cs
- ErrorView.xaml.cs
- ObjectSecurity.cs
- SHA256Managed.cs
- NativeObjectSecurity.cs
- _ListenerAsyncResult.cs
- WhitespaceRuleReader.cs
- GraphicsPath.cs
- GenericXmlSecurityToken.cs
- Models.cs
- MaskedTextProvider.cs
- WebPartDescription.cs
- XmlNullResolver.cs
- GrammarBuilderWildcard.cs
- CreateRefExpr.cs
- CompilationUnit.cs
- ServiceInfo.cs
- RuleSettings.cs
- ImageListUtils.cs
- ResponseBodyWriter.cs
- WsatProxy.cs
- Int32Rect.cs
- CacheAxisQuery.cs
- ContainerSelectorGlyph.cs
- X509Certificate2Collection.cs
- Token.cs
- CounterCreationDataCollection.cs
- XmlRootAttribute.cs
- PageThemeBuildProvider.cs
- Triplet.cs
- GridViewCancelEditEventArgs.cs
- BinaryWriter.cs
- CounterCreationDataCollection.cs
- ToolStripContentPanel.cs
- SignatureToken.cs
- StateChangeEvent.cs
- CryptoHelper.cs
- HScrollBar.cs
- EntityParameter.cs
- DependencyPropertyDescriptor.cs
- BlurEffect.cs
- BitmapEffectDrawingContent.cs
- ErrorLog.cs
- Color.cs
- PeerApplication.cs
- IteratorDescriptor.cs
- ToolStripDesignerAvailabilityAttribute.cs
- RawKeyboardInputReport.cs
- DefaultSection.cs
- DbProviderManifest.cs
- EmptyReadOnlyDictionaryInternal.cs
- NullableIntSumAggregationOperator.cs
- MailDefinitionBodyFileNameEditor.cs
- TypeLoadException.cs
- GroupedContextMenuStrip.cs
- Trace.cs
- AmbientLight.cs
- CellTreeNode.cs
- FullTrustAssemblyCollection.cs
- FrameworkElementFactory.cs
- TreeNodeClickEventArgs.cs
- ColorConverter.cs
- MediaTimeline.cs
- SignatureDescription.cs
- EntityDataSourceContainerNameConverter.cs
- SafeRightsManagementQueryHandle.cs
- RelationshipFixer.cs
- _CacheStreams.cs
- ContentElement.cs
- SqlTrackingQuery.cs
- HtmlElementEventArgs.cs
- ClientScriptItem.cs
- InvalidOperationException.cs
- TcpClientChannel.cs
- CharAnimationBase.cs
- FontTypeConverter.cs
- UIHelper.cs
- IntegerValidatorAttribute.cs
- WebServicesSection.cs
- ProfileSettings.cs
- SessionStateItemCollection.cs
- VersionedStream.cs
- entitydatasourceentitysetnameconverter.cs
- HttpListenerContext.cs
- TypeLoadException.cs
- NullableConverter.cs
- PlainXmlSerializer.cs
- FocusManager.cs
- TableLayout.cs
- AnnotationAuthorChangedEventArgs.cs
- DbParameterHelper.cs
- DecoderBestFitFallback.cs
- ContentPlaceHolder.cs