Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- EntityContainerEmitter.cs
- ToolStripScrollButton.cs
- BindingValueChangedEventArgs.cs
- SqlXmlStorage.cs
- TypedReference.cs
- ReferenceEqualityComparer.cs
- _NestedSingleAsyncResult.cs
- PagedDataSource.cs
- MailDefinition.cs
- OdbcEnvironmentHandle.cs
- MessageFilterException.cs
- SmtpNetworkElement.cs
- HostingEnvironment.cs
- CodeCatchClause.cs
- SponsorHelper.cs
- XmlCDATASection.cs
- MethodToken.cs
- WindowsFormsHostAutomationPeer.cs
- FormViewCommandEventArgs.cs
- DesignerActionMethodItem.cs
- XhtmlBasicListAdapter.cs
- EncodingConverter.cs
- RelativeSource.cs
- Canonicalizers.cs
- EllipseGeometry.cs
- ExtendedPropertyDescriptor.cs
- storepermission.cs
- LinkArea.cs
- RemotingConfiguration.cs
- SoapDocumentMethodAttribute.cs
- DesignerTransactionCloseEvent.cs
- DataMemberConverter.cs
- RegexMatchCollection.cs
- WebDisplayNameAttribute.cs
- SimpleHandlerBuildProvider.cs
- PageThemeParser.cs
- Translator.cs
- MemberMaps.cs
- DomainUpDown.cs
- QueryOptionExpression.cs
- assemblycache.cs
- SystemColors.cs
- AmbientLight.cs
- WpfXamlMember.cs
- LocalizableAttribute.cs
- WindowsRegion.cs
- GetWinFXPath.cs
- CustomAttributeSerializer.cs
- HttpModuleCollection.cs
- CompiledQuery.cs
- RuntimeConfigLKG.cs
- GridEntry.cs
- ListenerElementsCollection.cs
- DiscreteKeyFrames.cs
- URLAttribute.cs
- CheckBox.cs
- FileUpload.cs
- Parsers.cs
- CommandHelper.cs
- MissingMethodException.cs
- SessionEndingCancelEventArgs.cs
- IDispatchConstantAttribute.cs
- FileIOPermission.cs
- VideoDrawing.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- QilUnary.cs
- GridViewRowPresenterBase.cs
- UrlAuthorizationModule.cs
- EmbeddedMailObjectsCollection.cs
- XslVisitor.cs
- EntryWrittenEventArgs.cs
- ScopeCollection.cs
- DataBoundControlHelper.cs
- ContentElementCollection.cs
- Underline.cs
- VBIdentifierName.cs
- TreeNodeBindingCollection.cs
- ServicePointManager.cs
- TreeViewEvent.cs
- SRGSCompiler.cs
- PixelFormat.cs
- WinFormsComponentEditor.cs
- AttributeAction.cs
- JournalEntryStack.cs
- GridItem.cs
- ProtocolsConfigurationHandler.cs
- ByeMessageCD1.cs
- ValidatorCompatibilityHelper.cs
- UserControlBuildProvider.cs
- ActivityInstanceReference.cs
- CodeExpressionRuleDeclaration.cs
- invalidudtexception.cs
- XmlNodeComparer.cs
- BitmapVisualManager.cs
- LinqDataSourceDisposeEventArgs.cs
- Int32Rect.cs
- AdornerLayer.cs
- SqlRetyper.cs
- DataGridColumnCollection.cs
- FloaterBaseParagraph.cs