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
- DbgUtil.cs
- WebPartTransformer.cs
- BuiltInExpr.cs
- GlobalizationSection.cs
- EmptyEnumerator.cs
- AdCreatedEventArgs.cs
- FixedHyperLink.cs
- DataGridViewCellStyleChangedEventArgs.cs
- BatchServiceHost.cs
- FontConverter.cs
- CompilerLocalReference.cs
- StringBlob.cs
- CTreeGenerator.cs
- BooleanConverter.cs
- MethodBuilder.cs
- TypeValidationEventArgs.cs
- OdbcConnection.cs
- ValidatingPropertiesEventArgs.cs
- DbBuffer.cs
- HierarchicalDataBoundControl.cs
- XmlCDATASection.cs
- DrawingImage.cs
- UiaCoreApi.cs
- ModulesEntry.cs
- StorageMappingFragment.cs
- GcHandle.cs
- NavigationWindow.cs
- CompositeActivityTypeDescriptor.cs
- safelinkcollection.cs
- DynamicValueConverter.cs
- UrlPath.cs
- NameValueCache.cs
- StringToken.cs
- ToolBarPanel.cs
- SudsCommon.cs
- WCFBuildProvider.cs
- CfgParser.cs
- RewritingValidator.cs
- SqlRecordBuffer.cs
- StreamWriter.cs
- DBSqlParserTable.cs
- KoreanCalendar.cs
- EmptyEnumerator.cs
- ObjectDataSourceChooseTypePanel.cs
- SqlConnectionFactory.cs
- FileSystemEventArgs.cs
- NotFiniteNumberException.cs
- WindowsClaimSet.cs
- StatusBarItemAutomationPeer.cs
- TextUtf8RawTextWriter.cs
- ServiceChannelManager.cs
- NullableBoolConverter.cs
- FixedSOMPage.cs
- ElementNotEnabledException.cs
- TransactionChannel.cs
- ShaderRenderModeValidation.cs
- CustomPopupPlacement.cs
- DataViewManagerListItemTypeDescriptor.cs
- DependencyPropertyAttribute.cs
- HierarchicalDataTemplate.cs
- OdbcParameter.cs
- ReflectionTypeLoadException.cs
- OAVariantLib.cs
- PropertyDescriptorGridEntry.cs
- MouseGesture.cs
- HttpInputStream.cs
- BaseParser.cs
- WebConfigurationHostFileChange.cs
- SliderAutomationPeer.cs
- ContentTextAutomationPeer.cs
- CollectionView.cs
- ConfigXmlText.cs
- ConfigXmlWhitespace.cs
- HwndKeyboardInputProvider.cs
- EditorOptionAttribute.cs
- SiteMap.cs
- SatelliteContractVersionAttribute.cs
- DataFieldCollectionEditor.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- TTSEngineTypes.cs
- PackageProperties.cs
- XpsS0ValidatingLoader.cs
- CmsUtils.cs
- TraceUtils.cs
- OrderedEnumerableRowCollection.cs
- ItemsChangedEventArgs.cs
- FreezableCollection.cs
- InfocardClientCredentials.cs
- VectorAnimationUsingKeyFrames.cs
- ContextStaticAttribute.cs
- DateTimeConverter2.cs
- ZipIOLocalFileBlock.cs
- TraceHandlerErrorFormatter.cs
- bidPrivateBase.cs
- ServiceProviders.cs
- XMLDiffLoader.cs
- PasswordTextContainer.cs
- XmlDocumentSurrogate.cs
- HMACSHA256.cs
- MappedMetaModel.cs