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
- X509Utils.cs
- HostedImpersonationContext.cs
- InnerItemCollectionView.cs
- HttpApplicationFactory.cs
- X509Extension.cs
- SmtpReplyReader.cs
- TdsParserStateObject.cs
- AppModelKnownContentFactory.cs
- ResourceReferenceExpressionConverter.cs
- ManipulationStartingEventArgs.cs
- ParameterElementCollection.cs
- BinaryObjectInfo.cs
- KnownTypesProvider.cs
- XsltContext.cs
- ProfileBuildProvider.cs
- Model3D.cs
- NumberFormatter.cs
- ContainerParagraph.cs
- PerformanceCounterScope.cs
- MemberMaps.cs
- LogFlushAsyncResult.cs
- OptimizedTemplateContent.cs
- GridViewCancelEditEventArgs.cs
- Errors.cs
- SimpleLine.cs
- CodeSnippetExpression.cs
- ResourceExpression.cs
- RecommendedAsConfigurableAttribute.cs
- FlatButtonAppearance.cs
- DataFormats.cs
- Grid.cs
- FixedFindEngine.cs
- EditorReuseAttribute.cs
- odbcmetadatacollectionnames.cs
- DecoderFallbackWithFailureFlag.cs
- ButtonAutomationPeer.cs
- AesCryptoServiceProvider.cs
- IgnoreSection.cs
- Cloud.cs
- Internal.cs
- RootNamespaceAttribute.cs
- XmlSerializableWriter.cs
- PathSegment.cs
- DbReferenceCollection.cs
- UInt64Storage.cs
- DataGridViewCheckBoxColumn.cs
- DataAccessor.cs
- WebAdminConfigurationHelper.cs
- Attributes.cs
- ParameterCollectionEditor.cs
- LocalizationParserHooks.cs
- Triplet.cs
- XsdDuration.cs
- ParameterModifier.cs
- SafeCryptoHandles.cs
- _ConnectOverlappedAsyncResult.cs
- SmiGettersStream.cs
- EntityProviderServices.cs
- XmlQueryTypeFactory.cs
- DeferrableContent.cs
- ObjectCloneHelper.cs
- UriWriter.cs
- MulticastDelegate.cs
- InvalidPrinterException.cs
- TreeNode.cs
- DbParameterHelper.cs
- SlipBehavior.cs
- WebPartDescriptionCollection.cs
- TypedTableBaseExtensions.cs
- SolidColorBrush.cs
- ModelItemCollection.cs
- CacheRequest.cs
- NotifyInputEventArgs.cs
- ListView.cs
- HttpConfigurationContext.cs
- WebDisplayNameAttribute.cs
- MexHttpsBindingCollectionElement.cs
- PrefixHandle.cs
- Parameter.cs
- GridViewColumnCollection.cs
- DetailsViewInsertedEventArgs.cs
- XmlNamespaceMappingCollection.cs
- Util.cs
- StandardBindingImporter.cs
- DesignerHost.cs
- DiscreteKeyFrames.cs
- SRDisplayNameAttribute.cs
- XmlParserContext.cs
- ReceiveActivityDesigner.cs
- ConnectionStringSettings.cs
- BatchStream.cs
- GenericTypeParameterBuilder.cs
- EventMetadata.cs
- StateManagedCollection.cs
- DispatchOperation.cs
- ServiceHttpModule.cs
- PathStreamGeometryContext.cs
- RepeaterDataBoundAdapter.cs
- NumericUpDownAccelerationCollection.cs
- MonthChangedEventArgs.cs