Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DataServiceRequestOfT.cs
- CrossAppDomainChannel.cs
- CheckoutException.cs
- ScrollChangedEventArgs.cs
- TextSegment.cs
- AppDomainGrammarProxy.cs
- Input.cs
- WebRequestModulesSection.cs
- SmtpReplyReaderFactory.cs
- InkCanvasInnerCanvas.cs
- DataGridItem.cs
- MonitorWrapper.cs
- ListControl.cs
- QilFunction.cs
- mongolianshape.cs
- Scripts.cs
- AsyncOperationManager.cs
- XsdCachingReader.cs
- InternalControlCollection.cs
- UserControl.cs
- ObjectListComponentEditor.cs
- CodeTypeParameter.cs
- JpegBitmapEncoder.cs
- TableItemProviderWrapper.cs
- ListViewItemCollectionEditor.cs
- Events.cs
- WebPartEditVerb.cs
- StylusPointPropertyInfoDefaults.cs
- SmiSettersStream.cs
- SqlGenericUtil.cs
- DataGridViewRowHeaderCell.cs
- PageRanges.cs
- InstanceLockLostException.cs
- VersionPair.cs
- ECDiffieHellmanCng.cs
- DocumentViewerBase.cs
- PolicyReader.cs
- PKCS1MaskGenerationMethod.cs
- HierarchicalDataBoundControlAdapter.cs
- XXXOnTypeBuilderInstantiation.cs
- IxmlLineInfo.cs
- HostedHttpRequestAsyncResult.cs
- DynamicActivityProperty.cs
- DiscoveryServerProtocol.cs
- StaticExtensionConverter.cs
- InputBinding.cs
- SynchronousChannelMergeEnumerator.cs
- RangeExpression.cs
- Transform3DCollection.cs
- SmtpDigestAuthenticationModule.cs
- AttributeCollection.cs
- _AcceptOverlappedAsyncResult.cs
- IntranetCredentialPolicy.cs
- XmlSchemaSimpleType.cs
- InfoCardService.cs
- NativeMethods.cs
- EmptyControlCollection.cs
- TCPClient.cs
- Missing.cs
- cryptoapiTransform.cs
- RecognizedAudio.cs
- ByteStreamMessageUtility.cs
- DrawingAttributes.cs
- GenericRootAutomationPeer.cs
- TypeToken.cs
- PanelDesigner.cs
- SqlCacheDependencySection.cs
- CompositeDispatchFormatter.cs
- RowToParametersTransformer.cs
- SqlOuterApplyReducer.cs
- EventLogInternal.cs
- RelOps.cs
- EnumConverter.cs
- DataSourceHelper.cs
- ControlType.cs
- GenericPrincipal.cs
- GridLengthConverter.cs
- AttributeSetAction.cs
- ImageKeyConverter.cs
- XmlEncoding.cs
- MobileListItem.cs
- BlockUIContainer.cs
- Propagator.cs
- HtmlControlPersistable.cs
- BindingCompleteEventArgs.cs
- ParameterBuilder.cs
- SimpleType.cs
- XomlCompilerError.cs
- SqlExpander.cs
- DecoratedNameAttribute.cs
- SynchronousSendBindingElement.cs
- DateTimePicker.cs
- Stacktrace.cs
- BitVec.cs
- InternalConfigSettingsFactory.cs
- ISO2022Encoding.cs
- DefaultBindingPropertyAttribute.cs
- XamlStream.cs
- SelectionProcessor.cs
- WindowsIdentity.cs