Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DBCommand.cs
- MatrixAnimationUsingKeyFrames.cs
- newinstructionaction.cs
- EventProxy.cs
- UserInitiatedNavigationPermission.cs
- Line.cs
- InvalidPrinterException.cs
- MenuItemStyleCollection.cs
- ExecutedRoutedEventArgs.cs
- KeyConstraint.cs
- EasingKeyFrames.cs
- EventWaitHandleSecurity.cs
- LoadItemsEventArgs.cs
- RegexFCD.cs
- ReliableReplySessionChannel.cs
- BooleanExpr.cs
- ListViewSortEventArgs.cs
- PropertyGridEditorPart.cs
- CodeRemoveEventStatement.cs
- DataGridViewRowPrePaintEventArgs.cs
- PreviewKeyDownEventArgs.cs
- PreservationFileWriter.cs
- AsymmetricAlgorithm.cs
- SystemWebSectionGroup.cs
- BinHexEncoder.cs
- OptimizerPatterns.cs
- EdmItemError.cs
- FileLevelControlBuilderAttribute.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- TimeSpanSecondsConverter.cs
- DataGridViewRowsAddedEventArgs.cs
- TemplatedEditableDesignerRegion.cs
- RadioButtonList.cs
- WebRequest.cs
- HtmlGenericControl.cs
- Quad.cs
- CriticalFinalizerObject.cs
- BindingWorker.cs
- UIElement3D.cs
- DesignerCategoryAttribute.cs
- DataGridItemCollection.cs
- DataGridViewCellCancelEventArgs.cs
- FileLoadException.cs
- PointLightBase.cs
- ButtonBaseAutomationPeer.cs
- LeftCellWrapper.cs
- TreeNodeStyle.cs
- DesignerLoader.cs
- SemaphoreSecurity.cs
- DbConnectionPoolGroupProviderInfo.cs
- FormattedTextSymbols.cs
- DataTableExtensions.cs
- UrlAuthorizationModule.cs
- PcmConverter.cs
- TraceData.cs
- StringCollection.cs
- shaperfactory.cs
- SystemInfo.cs
- XmlBufferReader.cs
- GlobalizationAssembly.cs
- ObjectPersistData.cs
- ToolStripDropDownClosingEventArgs.cs
- DrawingCollection.cs
- CodeTypeDelegate.cs
- DataGridCellsPresenter.cs
- COM2ColorConverter.cs
- ByteStreamGeometryContext.cs
- WebReferencesBuildProvider.cs
- FieldBuilder.cs
- BindingBase.cs
- AutomationAttributeInfo.cs
- ConfigPathUtility.cs
- TraceFilter.cs
- AlphaSortedEnumConverter.cs
- ResponseStream.cs
- Int64AnimationBase.cs
- SystemEvents.cs
- ParagraphVisual.cs
- MultiTrigger.cs
- CodeEventReferenceExpression.cs
- ReferencedAssembly.cs
- HttpHeaderCollection.cs
- ThaiBuddhistCalendar.cs
- BitArray.cs
- ConcurrentStack.cs
- EditorPartCollection.cs
- TypeDescriptor.cs
- DbConnectionPoolOptions.cs
- ExternalDataExchangeService.cs
- Site.cs
- ServiceAuthorizationBehavior.cs
- XPathNodeHelper.cs
- OutputScopeManager.cs
- Function.cs
- VisualBasicSettings.cs
- TargetControlTypeCache.cs
- PermissionRequestEvidence.cs
- WebConfigManager.cs
- SystemGatewayIPAddressInformation.cs
- RunInstallerAttribute.cs