Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeElement.cs
- TaskCanceledException.cs
- SelectedGridItemChangedEvent.cs
- ScriptServiceAttribute.cs
- QueryableFilterUserControl.cs
- DataGridState.cs
- RunClient.cs
- EventLogEntryCollection.cs
- UIPermission.cs
- LambdaSerializationException.cs
- TypedDatasetGenerator.cs
- TransformerTypeCollection.cs
- SystemPens.cs
- TextTreeRootTextBlock.cs
- FlowLayout.cs
- SqlNotificationEventArgs.cs
- CodeBlockBuilder.cs
- ThreadAttributes.cs
- StrokeNodeData.cs
- TreeNodeClickEventArgs.cs
- WebPartHeaderCloseVerb.cs
- __ComObject.cs
- DataGridViewComboBoxCell.cs
- EnumValAlphaComparer.cs
- FactoryMaker.cs
- Adorner.cs
- DataControlLinkButton.cs
- _SpnDictionary.cs
- CodeConstructor.cs
- SkewTransform.cs
- DrawItemEvent.cs
- List.cs
- ProxyFragment.cs
- LinqDataSourceUpdateEventArgs.cs
- ServiceReference.cs
- MemberAccessException.cs
- SortDescriptionCollection.cs
- ManipulationStartedEventArgs.cs
- TemplateControl.cs
- DbParameterHelper.cs
- complextypematerializer.cs
- ServiceEndpointAssociationProvider.cs
- Win32Exception.cs
- StylusPointProperties.cs
- ItemCollection.cs
- ControlBuilderAttribute.cs
- DBConnectionString.cs
- BindingMemberInfo.cs
- ErrorActivity.cs
- TextBlockAutomationPeer.cs
- ResourceDescriptionAttribute.cs
- CodeStatementCollection.cs
- TemplateApplicationHelper.cs
- ClientBuildManagerCallback.cs
- Typography.cs
- CompositeActivityMarkupSerializer.cs
- MetadataCache.cs
- UIElement3D.cs
- Visual.cs
- PaperSource.cs
- ControlEvent.cs
- DPCustomTypeDescriptor.cs
- IdentityVerifier.cs
- MenuItemBinding.cs
- SelectionEditor.cs
- HttpWebRequest.cs
- DoWorkEventArgs.cs
- AddInIpcChannel.cs
- WebRequestModuleElementCollection.cs
- PrtCap_Builder.cs
- HtmlLink.cs
- SortDescription.cs
- Mappings.cs
- CoTaskMemUnicodeSafeHandle.cs
- CompositeKey.cs
- DataConnectionHelper.cs
- OleServicesContext.cs
- OracleParameterBinding.cs
- Missing.cs
- Vector3DAnimation.cs
- TypeSource.cs
- NTAccount.cs
- MonthChangedEventArgs.cs
- StickyNoteAnnotations.cs
- ComponentResourceManager.cs
- HttpChannelBindingToken.cs
- ResponseBodyWriter.cs
- AttachedPropertyMethodSelector.cs
- HttpResponseWrapper.cs
- AdCreatedEventArgs.cs
- SystemSounds.cs
- RectangleGeometry.cs
- ConstantExpression.cs
- XamlInterfaces.cs
- AnyReturnReader.cs
- ToolboxItemAttribute.cs
- ApplicationFileCodeDomTreeGenerator.cs
- LineMetrics.cs
- NamespaceInfo.cs
- DBDataPermissionAttribute.cs