Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- KoreanCalendar.cs
- FrameworkElementAutomationPeer.cs
- Emitter.cs
- XamlStyleSerializer.cs
- ElementAction.cs
- RightNameExpirationInfoPair.cs
- ComboBoxDesigner.cs
- WhitespaceRule.cs
- MLangCodePageEncoding.cs
- WsatServiceCertificate.cs
- HtmlProps.cs
- AvTraceDetails.cs
- FocusWithinProperty.cs
- DataBindingList.cs
- InternalSafeNativeMethods.cs
- SafeNativeMethods.cs
- TableCell.cs
- querybuilder.cs
- AsnEncodedData.cs
- HScrollBar.cs
- PageBuildProvider.cs
- WebRequest.cs
- QueryStatement.cs
- HtmlWindowCollection.cs
- DataGridView.cs
- MetadataSource.cs
- LineGeometry.cs
- PipeConnection.cs
- CircleEase.cs
- ContainerSelectorGlyph.cs
- DecodeHelper.cs
- MultiAsyncResult.cs
- Options.cs
- ProfileManager.cs
- RemoteWebConfigurationHost.cs
- SortQuery.cs
- UnaryExpression.cs
- NumericExpr.cs
- HttpGetServerProtocol.cs
- ExclusiveTcpTransportManager.cs
- ControlValuePropertyAttribute.cs
- SourceFileBuildProvider.cs
- PageCopyCount.cs
- TabItemAutomationPeer.cs
- Walker.cs
- RijndaelCryptoServiceProvider.cs
- ImageBrush.cs
- FixedSOMGroup.cs
- AbandonedMutexException.cs
- TreeNodeMouseHoverEvent.cs
- PersonalizablePropertyEntry.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- HiddenFieldPageStatePersister.cs
- Scripts.cs
- ConnectionPoolManager.cs
- AsyncPostBackErrorEventArgs.cs
- XamlHostingSection.cs
- MimeReflector.cs
- DefaultSection.cs
- ByteRangeDownloader.cs
- FreezableCollection.cs
- DefaultTraceListener.cs
- TypeConverterAttribute.cs
- CacheEntry.cs
- ViewCellSlot.cs
- FacetChecker.cs
- ToolStripSplitStackLayout.cs
- SQLByteStorage.cs
- DataViewManager.cs
- FileDialogCustomPlace.cs
- CompilerError.cs
- SystemDropShadowChrome.cs
- RemotingSurrogateSelector.cs
- ProjectionNode.cs
- HtmlObjectListAdapter.cs
- PersistenceTypeAttribute.cs
- BatchParser.cs
- ColorIndependentAnimationStorage.cs
- TableStyle.cs
- processwaithandle.cs
- QilUnary.cs
- Stack.cs
- DoubleConverter.cs
- WebPartMenu.cs
- LiteralSubsegment.cs
- NGCUIElementCollectionSerializerAsync.cs
- ListViewGroupConverter.cs
- ServiceNameCollection.cs
- Formatter.cs
- StoreItemCollection.cs
- Blend.cs
- DesignerToolboxInfo.cs
- VirtualDirectoryMapping.cs
- DigitShape.cs
- InvalidOperationException.cs
- CqlBlock.cs
- CodeConditionStatement.cs
- EntityDataSourceSelectedEventArgs.cs
- DesignerActionUIService.cs
- DataSvcMapFile.cs