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
- EntityCollection.cs
- oledbmetadatacolumnnames.cs
- InstanceDataCollection.cs
- TimelineClockCollection.cs
- CompressionTransform.cs
- Directory.cs
- UpdateCompiler.cs
- NavigatorOutput.cs
- FlowNode.cs
- DelayedRegex.cs
- Compiler.cs
- InkCollectionBehavior.cs
- SqlCommandBuilder.cs
- EditorPart.cs
- WorkItem.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- TraceContext.cs
- ConfigurationValidatorAttribute.cs
- BinaryNode.cs
- ReadingWritingEntityEventArgs.cs
- EventMappingSettings.cs
- TcpChannelListener.cs
- DbConnectionPoolGroup.cs
- ListViewDeleteEventArgs.cs
- DependencyObjectType.cs
- TextTreeUndoUnit.cs
- UnicastIPAddressInformationCollection.cs
- SequentialOutput.cs
- CodeAssignStatement.cs
- MenuItem.cs
- HttpWebRequest.cs
- ApplicationFileCodeDomTreeGenerator.cs
- InkCanvasInnerCanvas.cs
- ISO2022Encoding.cs
- SqlProcedureAttribute.cs
- OdbcConnectionString.cs
- Selector.cs
- ClientApiGenerator.cs
- ThreadPoolTaskScheduler.cs
- BoundColumn.cs
- WebBrowserPermission.cs
- WmlControlAdapter.cs
- ChtmlTextWriter.cs
- SynchronizedInputAdaptor.cs
- WeakEventManager.cs
- PolyBezierSegment.cs
- TimerEventSubscription.cs
- Msmq3PoisonHandler.cs
- OrderedDictionary.cs
- PointUtil.cs
- StylusButton.cs
- SecurityCriticalDataForSet.cs
- SpecialFolderEnumConverter.cs
- KeyTime.cs
- FrameSecurityDescriptor.cs
- CheckBoxField.cs
- AssemblyBuilderData.cs
- ProviderException.cs
- Calendar.cs
- CreateUserWizard.cs
- ChooseAction.cs
- ServiceAuthorizationBehavior.cs
- TextRunCache.cs
- RoleGroupCollection.cs
- FontUnitConverter.cs
- PixelFormat.cs
- EncoderBestFitFallback.cs
- DateTimeParse.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ProcessThread.cs
- TableAutomationPeer.cs
- Point3DCollection.cs
- RemoteWebConfigurationHost.cs
- SystemTcpStatistics.cs
- TextEffectCollection.cs
- Icon.cs
- TextDecorationLocationValidation.cs
- Adorner.cs
- DescendentsWalker.cs
- InvalidCastException.cs
- MeasurementDCInfo.cs
- DesignerDataView.cs
- LineUtil.cs
- TextRange.cs
- SecureConversationServiceElement.cs
- AlternateViewCollection.cs
- SystemIPv6InterfaceProperties.cs
- SwitchElementsCollection.cs
- EntitySetBaseCollection.cs
- DeviceContext.cs
- OleDbConnectionFactory.cs
- SerialReceived.cs
- SQLUtility.cs
- CounterCreationData.cs
- QilIterator.cs
- AssemblyCache.cs
- XamlReader.cs
- XmlSchemaValidationException.cs
- StrokeNodeEnumerator.cs
- DecoderFallbackWithFailureFlag.cs