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
- xsdvalidator.cs
- ModelEditingScope.cs
- PtsPage.cs
- Block.cs
- NetworkInformationPermission.cs
- wgx_exports.cs
- FreezableCollection.cs
- ItemMap.cs
- CredentialCache.cs
- CharEntityEncoderFallback.cs
- MobileControl.cs
- ColorBuilder.cs
- FontFamilyValueSerializer.cs
- ResourceManagerWrapper.cs
- VirtualPathProvider.cs
- PolyLineSegment.cs
- WebContext.cs
- ImageMetadata.cs
- ObjectViewEntityCollectionData.cs
- VarRefManager.cs
- BamlVersionHeader.cs
- DataGridColumnCollection.cs
- MimeMapping.cs
- TextRangeBase.cs
- RenameRuleObjectDialog.Designer.cs
- BitmapInitialize.cs
- WebHeaderCollection.cs
- GridViewCancelEditEventArgs.cs
- RelationshipManager.cs
- GestureRecognitionResult.cs
- XmlILOptimizerVisitor.cs
- Directory.cs
- LeaseManager.cs
- ObjectDataSourceDisposingEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- CqlParser.cs
- XPathDocument.cs
- CommonGetThemePartSize.cs
- PtsCache.cs
- BitmapCache.cs
- SafeEventLogReadHandle.cs
- SecurityContextKeyIdentifierClause.cs
- TabOrder.cs
- PropertyGridEditorPart.cs
- KerberosSecurityTokenAuthenticator.cs
- PersonalizationState.cs
- CustomAttribute.cs
- SoapParser.cs
- TemplateComponentConnector.cs
- ToolStripContentPanel.cs
- ColorPalette.cs
- KeyPressEvent.cs
- PageEventArgs.cs
- AppSettingsReader.cs
- WorkflowViewManager.cs
- UriScheme.cs
- ServiceOperation.cs
- DataGridViewLayoutData.cs
- SmtpLoginAuthenticationModule.cs
- SafeSecurityHelper.cs
- Journaling.cs
- TimeEnumHelper.cs
- XXXInfos.cs
- ListBoxItemWrapperAutomationPeer.cs
- EditorZone.cs
- BitmapEffectDrawingContextState.cs
- LinearGradientBrush.cs
- XamlReaderConstants.cs
- EventListenerClientSide.cs
- HttpVersion.cs
- AudioBase.cs
- EntityDesignerDataSourceView.cs
- SafeWaitHandle.cs
- CriticalExceptions.cs
- TextDocumentView.cs
- Lasso.cs
- Activator.cs
- InlineCollection.cs
- CollectionContainer.cs
- ResourcePermissionBaseEntry.cs
- OutputCacheModule.cs
- ToolboxItemFilterAttribute.cs
- DataGridViewCellStyleConverter.cs
- DesignerObject.cs
- ManagementNamedValueCollection.cs
- DependencyPropertyHelper.cs
- ListViewGroup.cs
- SafeHandles.cs
- RuntimeCompatibilityAttribute.cs
- QilTargetType.cs
- HtmlTextArea.cs
- GenerateHelper.cs
- ComponentManagerBroker.cs
- UrlMappingsSection.cs
- Rfc2898DeriveBytes.cs
- SafeNativeMethods.cs
- ObjectDataSourceView.cs
- XmlEncodedRawTextWriter.cs
- ScriptResourceHandler.cs
- DynamicRendererThreadManager.cs