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
- MainMenu.cs
- CodeCommentStatement.cs
- MulticastDelegate.cs
- DataGridViewToolTip.cs
- QueryConverter.cs
- VersionedStreamOwner.cs
- FixedSOMLineCollection.cs
- FixedSOMImage.cs
- mansign.cs
- EventPrivateKey.cs
- NameValuePermission.cs
- ComponentRenameEvent.cs
- KeyGestureConverter.cs
- TableRowCollection.cs
- MenuItemCollection.cs
- ColumnClickEvent.cs
- DropSource.cs
- XPathParser.cs
- AutoResetEvent.cs
- XsltOutput.cs
- TextChange.cs
- GenericWebPart.cs
- Selection.cs
- XPathScanner.cs
- RijndaelManaged.cs
- UiaCoreApi.cs
- HandledMouseEvent.cs
- PrimarySelectionGlyph.cs
- UnmanagedMemoryStream.cs
- SequenceDesigner.xaml.cs
- MetadataExchangeBindings.cs
- BrowserCapabilitiesFactory.cs
- Convert.cs
- MouseCaptureWithinProperty.cs
- CalendarTable.cs
- BuildProvider.cs
- Model3D.cs
- TimeZone.cs
- ToolStripDropDownMenu.cs
- BaseParaClient.cs
- Error.cs
- SchemaConstraints.cs
- CompositeFontInfo.cs
- ToolStripPanelRenderEventArgs.cs
- SessionStateItemCollection.cs
- TableRowCollection.cs
- ResourceContainer.cs
- ListView.cs
- InvalidStoreProtectionKeyException.cs
- FtpWebResponse.cs
- SegmentInfo.cs
- UrlMappingsSection.cs
- RectangleHotSpot.cs
- ExternalException.cs
- HttpListenerResponse.cs
- DecoderReplacementFallback.cs
- propertytag.cs
- ErrorBehavior.cs
- PipelineModuleStepContainer.cs
- SqlConnectionPoolProviderInfo.cs
- GlyphRunDrawing.cs
- SimpleBitVector32.cs
- SimpleWorkerRequest.cs
- DataGridPagingPage.cs
- NamespaceInfo.cs
- DataGridTable.cs
- HyperLink.cs
- SettingsProviderCollection.cs
- MD5.cs
- StackOverflowException.cs
- DecoderFallback.cs
- CodeDirectionExpression.cs
- WindowsEditBox.cs
- RequestSecurityToken.cs
- SecurityContext.cs
- XComponentModel.cs
- WebBrowserUriTypeConverter.cs
- SimpleColumnProvider.cs
- WebServiceBindingAttribute.cs
- ListItemCollection.cs
- Int64.cs
- DataGridCellItemAutomationPeer.cs
- XmlObjectSerializerContext.cs
- QualifierSet.cs
- DataObjectFieldAttribute.cs
- QueryOptionExpression.cs
- SByteConverter.cs
- HyperlinkAutomationPeer.cs
- PathTooLongException.cs
- ChangePassword.cs
- AnnotationHelper.cs
- SqlAliaser.cs
- MetadataUtilsSmi.cs
- UpdateExpressionVisitor.cs
- LicenseProviderAttribute.cs
- DataGridGeneralPage.cs
- Compensation.cs
- HtmlTableRowCollection.cs
- KeyEvent.cs
- WebBrowserPermission.cs