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
- ImageListStreamer.cs
- LineMetrics.cs
- CommandField.cs
- DispatchChannelSink.cs
- FormCollection.cs
- XmlIncludeAttribute.cs
- ModuleBuilder.cs
- ValueType.cs
- RedirectionProxy.cs
- CommandLineParser.cs
- Size3D.cs
- WindowsToolbarAsMenu.cs
- TextSerializer.cs
- InvokeProviderWrapper.cs
- WindowsFormsDesignerOptionService.cs
- bindurihelper.cs
- TaskFormBase.cs
- DependencyPropertyValueSerializer.cs
- XmlQueryCardinality.cs
- _LoggingObject.cs
- StreamUpgradeProvider.cs
- QueryIntervalOp.cs
- Win32Native.cs
- FlowDocumentScrollViewer.cs
- ApplicationServicesHostFactory.cs
- HMACSHA512.cs
- MutexSecurity.cs
- KeyboardNavigation.cs
- WebRequest.cs
- EndPoint.cs
- KeyTime.cs
- SecurityTokenTypes.cs
- DbConnectionOptions.cs
- ExtensionDataObject.cs
- DependencyPropertyConverter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataSpaceManager.cs
- UnsafeMethods.cs
- XpsSerializationManagerAsync.cs
- FileSecurity.cs
- CheckBoxRenderer.cs
- XmlMemberMapping.cs
- SelectManyQueryOperator.cs
- BitmapDecoder.cs
- InvalidDataException.cs
- SmiContextFactory.cs
- DataSourceControl.cs
- EmptyTextWriter.cs
- XamlGridLengthSerializer.cs
- LabelInfo.cs
- SqlVersion.cs
- MetadataArtifactLoaderFile.cs
- ScrollData.cs
- Propagator.JoinPropagator.cs
- DragDeltaEventArgs.cs
- CodeValidator.cs
- UInt64Converter.cs
- HttpModuleActionCollection.cs
- HiddenField.cs
- Rotation3DAnimation.cs
- DispatcherTimer.cs
- Table.cs
- XmlReflectionImporter.cs
- UIElement3DAutomationPeer.cs
- WindowsScrollBarBits.cs
- BitmapImage.cs
- SoapHeader.cs
- ObjectHandle.cs
- AvTraceFormat.cs
- GridView.cs
- ProgressBarAutomationPeer.cs
- SqlCommand.cs
- Viewport2DVisual3D.cs
- ListControlDataBindingHandler.cs
- DesignerAutoFormatCollection.cs
- PropertyChange.cs
- CrossContextChannel.cs
- ParseNumbers.cs
- GestureRecognitionResult.cs
- LineMetrics.cs
- ScriptRegistrationManager.cs
- DataAdapter.cs
- WebPartUtil.cs
- Switch.cs
- SelectionRange.cs
- TypeContext.cs
- ExpandedWrapper.cs
- State.cs
- TextSegment.cs
- ButtonStandardAdapter.cs
- ListView.cs
- DescendantQuery.cs
- exports.cs
- WebZone.cs
- DelegatingTypeDescriptionProvider.cs
- SourceFileInfo.cs
- CmsInterop.cs
- TextEvent.cs
- AnnotationService.cs
- BrowserCapabilitiesFactoryBase.cs