Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //[....] //----------------------------------------------------------------------------- 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
- DecimalStorage.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- MarkupWriter.cs
- CollectionViewGroupRoot.cs
- PropertyToken.cs
- WebCodeGenerator.cs
- IRCollection.cs
- RectangleGeometry.cs
- ActionMismatchAddressingException.cs
- CheckBoxPopupAdapter.cs
- KeyFrames.cs
- XmlComplianceUtil.cs
- LinqDataSource.cs
- SmtpLoginAuthenticationModule.cs
- GatewayDefinition.cs
- GridItemPatternIdentifiers.cs
- UnescapedXmlDiagnosticData.cs
- MenuEventArgs.cs
- ZipPackage.cs
- arc.cs
- RotateTransform3D.cs
- OneOfScalarConst.cs
- TransformGroup.cs
- GeneratedView.cs
- MarkupExtensionParser.cs
- Utility.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- RoutedEventHandlerInfo.cs
- TextFormatterHost.cs
- AnnotationResourceChangedEventArgs.cs
- BitmapEffectInputConnector.cs
- EmptyEnumerator.cs
- RefreshPropertiesAttribute.cs
- RegistryConfigurationProvider.cs
- Adorner.cs
- OLEDB_Util.cs
- FormsAuthenticationModule.cs
- ImageSourceValueSerializer.cs
- EdmPropertyAttribute.cs
- GeneralTransform3DCollection.cs
- SHA1.cs
- CodeExpressionStatement.cs
- TextUtf8RawTextWriter.cs
- ParseElement.cs
- SymmetricAlgorithm.cs
- OAVariantLib.cs
- DbConnectionOptions.cs
- XmlQueryTypeFactory.cs
- WebConfigurationHost.cs
- CuspData.cs
- ErrorLog.cs
- CheckBox.cs
- WMICapabilities.cs
- ConfigXmlComment.cs
- QueryStringParameter.cs
- dataobject.cs
- TemplateBindingExtension.cs
- SystemUdpStatistics.cs
- ClickablePoint.cs
- Part.cs
- ReceiveActivityDesignerTheme.cs
- Stacktrace.cs
- BaseTemplateParser.cs
- SystemWebExtensionsSectionGroup.cs
- UnsignedPublishLicense.cs
- WebPartEventArgs.cs
- MaskedTextProvider.cs
- XmlDataFileEditor.cs
- ImpersonateTokenRef.cs
- BufferedResponseStream.cs
- HttpListenerElement.cs
- DataRowView.cs
- CustomErrorCollection.cs
- figurelength.cs
- WindowsRebar.cs
- ProviderMetadata.cs
- ACL.cs
- BaseDataListPage.cs
- RuntimeEnvironment.cs
- DbDataReader.cs
- EntityExpressionVisitor.cs
- OdbcEnvironmentHandle.cs
- BaseCodePageEncoding.cs
- SmtpTransport.cs
- XmlNavigatorFilter.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- TableRow.cs
- StringFunctions.cs
- DesignerInterfaces.cs
- Assembly.cs
- Image.cs
- ContentPlaceHolder.cs
- CustomValidator.cs
- RawStylusActions.cs
- HtmlTextArea.cs
- XmlSchemaCollection.cs
- SqlTransaction.cs
- printdlgexmarshaler.cs
- SafeNativeMethods.cs
- MiniConstructorInfo.cs