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
- DllHostInitializer.cs
- MdiWindowListItemConverter.cs
- InlineCollection.cs
- GroupDescription.cs
- Model3D.cs
- CorePropertiesFilter.cs
- ExtensionMethods.cs
- Operand.cs
- RTLAwareMessageBox.cs
- ParallelEnumerable.cs
- QilScopedVisitor.cs
- DataRecordInfo.cs
- TextStore.cs
- EncoderNLS.cs
- NamespaceInfo.cs
- DateTimeFormatInfo.cs
- HtmlInputPassword.cs
- HttpVersion.cs
- DivideByZeroException.cs
- ConfigurationConverterBase.cs
- CodeArgumentReferenceExpression.cs
- EllipseGeometry.cs
- SQLByte.cs
- VirtualDirectoryMapping.cs
- TextBox.cs
- Unit.cs
- GPPOINTF.cs
- UpdateDelegates.Generated.cs
- UnmanagedMemoryStreamWrapper.cs
- DataServiceBuildProvider.cs
- PageThemeCodeDomTreeGenerator.cs
- ImportContext.cs
- EventLogException.cs
- DecoderBestFitFallback.cs
- Ipv6Element.cs
- VarRefManager.cs
- MailDefinitionBodyFileNameEditor.cs
- FlowPanelDesigner.cs
- VectorKeyFrameCollection.cs
- HeaderPanel.cs
- CompositeKey.cs
- CorrelationManager.cs
- HttpHostedTransportConfiguration.cs
- DataControlPagerLinkButton.cs
- WindowsListViewGroupHelper.cs
- DbConnectionHelper.cs
- MSAAEventDispatcher.cs
- SqlNodeAnnotations.cs
- XmlUtil.cs
- BindValidator.cs
- ElementHostPropertyMap.cs
- HttpModulesInstallComponent.cs
- COAUTHIDENTITY.cs
- ControlBuilderAttribute.cs
- HtmlElementErrorEventArgs.cs
- Helper.cs
- Msmq4SubqueuePoisonHandler.cs
- Operand.cs
- ToolStripPanelRow.cs
- DBConnectionString.cs
- MailWebEventProvider.cs
- LineInfo.cs
- _SSPIWrapper.cs
- SchemaImporterExtension.cs
- Delegate.cs
- UserNamePasswordValidator.cs
- SmtpTransport.cs
- EventPrivateKey.cs
- XmlArrayItemAttributes.cs
- dtdvalidator.cs
- ListControl.cs
- GraphicsPath.cs
- SettingsProperty.cs
- XmlSequenceWriter.cs
- SourceFileInfo.cs
- ObjectDataSourceView.cs
- MSG.cs
- PersonalizableAttribute.cs
- PointLight.cs
- PackWebRequest.cs
- Listbox.cs
- ImageList.cs
- RangeContentEnumerator.cs
- ConfigXmlElement.cs
- DropSource.cs
- SystemUnicastIPAddressInformation.cs
- LexicalChunk.cs
- TimeZoneNotFoundException.cs
- FieldMetadata.cs
- NamedPipeProcessProtocolHandler.cs
- HierarchicalDataBoundControl.cs
- ToolStripLabel.cs
- SerializationFieldInfo.cs
- RelationalExpressions.cs
- SqlXml.cs
- OracleMonthSpan.cs
- RegexWorker.cs
- DBSchemaRow.cs
- MimeMapping.cs
- RotationValidation.cs