Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompilationUtil.cs
- DictionaryContent.cs
- BeginEvent.cs
- ContainsSearchOperator.cs
- StaticExtensionConverter.cs
- TrustManager.cs
- MatrixTransform.cs
- _IPv4Address.cs
- BevelBitmapEffect.cs
- WebScriptClientGenerator.cs
- DataSet.cs
- BamlStream.cs
- Shape.cs
- SurrogateSelector.cs
- SqlParameter.cs
- OleDbConnectionFactory.cs
- AnnotationComponentManager.cs
- DiscoveryClientProtocol.cs
- Empty.cs
- AmbiguousMatchException.cs
- FormatConvertedBitmap.cs
- Context.cs
- PlanCompilerUtil.cs
- PrivilegeNotHeldException.cs
- ServiceOperation.cs
- ObjectStateFormatter.cs
- ContainsRowNumberChecker.cs
- Privilege.cs
- CustomErrorsSection.cs
- RenderContext.cs
- SessionEndedEventArgs.cs
- GifBitmapDecoder.cs
- ProcessThreadCollection.cs
- ComponentResourceKeyConverter.cs
- FlatButtonAppearance.cs
- WebSysDisplayNameAttribute.cs
- MailMessage.cs
- URIFormatException.cs
- DayRenderEvent.cs
- SqlServices.cs
- InputElement.cs
- XamlInterfaces.cs
- OperationInfo.cs
- TableCellCollection.cs
- OleDbWrapper.cs
- DataGridViewMethods.cs
- ErasingStroke.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- StylusDownEventArgs.cs
- _SslStream.cs
- FtpRequestCacheValidator.cs
- ListViewDataItem.cs
- IndentedTextWriter.cs
- CalendarButton.cs
- PageBreakRecord.cs
- SystemMulticastIPAddressInformation.cs
- ToolStripSplitButton.cs
- PtsHost.cs
- BamlReader.cs
- SmiXetterAccessMap.cs
- SessionStateModule.cs
- StringAnimationBase.cs
- DTCTransactionManager.cs
- PropertyEmitter.cs
- Suspend.cs
- BitmapDecoder.cs
- MD5CryptoServiceProvider.cs
- AnnotationResource.cs
- RNGCryptoServiceProvider.cs
- HtmlInputButton.cs
- Rotation3DKeyFrameCollection.cs
- SqlDataSource.cs
- RangeBase.cs
- MethodToken.cs
- oledbmetadatacolumnnames.cs
- CheckBoxPopupAdapter.cs
- MaterialGroup.cs
- SqlResolver.cs
- AttachedPropertyBrowsableAttribute.cs
- ValidatedControlConverter.cs
- HttpHandlerActionCollection.cs
- XmlDataLoader.cs
- WebUtil.cs
- DateTimeOffset.cs
- ExtensibleClassFactory.cs
- Documentation.cs
- ReferenceConverter.cs
- _AuthenticationState.cs
- QueryStatement.cs
- MimeMapping.cs
- PageMediaType.cs
- XPathSelfQuery.cs
- AttachedPropertyBrowsableAttribute.cs
- DropDownButton.cs
- EmptyControlCollection.cs
- ValidationSummary.cs
- AutomationEvent.cs
- HashAlgorithm.cs
- NotFiniteNumberException.cs
- DetailsViewPagerRow.cs