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
- PersonalizationEntry.cs
- ToolStripContentPanelRenderEventArgs.cs
- IntegrationExceptionEventArgs.cs
- PathFigureCollectionConverter.cs
- InputMethodStateChangeEventArgs.cs
- SerializationFieldInfo.cs
- GlobalizationAssembly.cs
- Simplifier.cs
- SafeRightsManagementEnvironmentHandle.cs
- AccessedThroughPropertyAttribute.cs
- DesignerEditorPartChrome.cs
- InstanceKeyCompleteException.cs
- BypassElement.cs
- IDataContractSurrogate.cs
- MetabaseSettingsIis7.cs
- ActionMismatchAddressingException.cs
- DBSchemaTable.cs
- TimeoutStream.cs
- RectangleHotSpot.cs
- SmiContextFactory.cs
- HtmlShimManager.cs
- PriorityBindingExpression.cs
- TableItemPattern.cs
- InternalConfigEventArgs.cs
- Column.cs
- WebReferenceOptions.cs
- NetworkInterface.cs
- NativeMethods.cs
- AuthenticationModuleElementCollection.cs
- WeakRefEnumerator.cs
- CodeDelegateInvokeExpression.cs
- ActivityDesignerHighlighter.cs
- EtwTrackingBehavior.cs
- ipaddressinformationcollection.cs
- ProtocolElement.cs
- NativeMethods.cs
- EventSinkHelperWriter.cs
- ScriptManagerProxy.cs
- ObjectViewEntityCollectionData.cs
- DataSourceSelectArguments.cs
- RuntimeEnvironment.cs
- SelectionItemProviderWrapper.cs
- QueuePropertyVariants.cs
- SqlDataSourceParameterParser.cs
- SimpleTypesSurrogate.cs
- XmlBinaryReader.cs
- WebAdminConfigurationHelper.cs
- DbMetaDataFactory.cs
- DataSourceProvider.cs
- BaseValidator.cs
- diagnosticsswitches.cs
- Menu.cs
- TextBoxDesigner.cs
- UnsafeNativeMethods.cs
- EntityConnection.cs
- XmlWriterTraceListener.cs
- BooleanProjectedSlot.cs
- PtsCache.cs
- PrintPageEvent.cs
- DesignerCommandSet.cs
- RuntimeConfigurationRecord.cs
- TreeNodeCollectionEditor.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- ScrollPattern.cs
- DataObjectPastingEventArgs.cs
- UdpUtility.cs
- SafeArchiveContext.cs
- WebPartCloseVerb.cs
- SqlConnectionString.cs
- ControlBuilderAttribute.cs
- AddingNewEventArgs.cs
- ApplicationSecurityManager.cs
- TileModeValidation.cs
- CorruptStoreException.cs
- ProfileBuildProvider.cs
- ToolStripOverflowButton.cs
- ListViewItem.cs
- StringConverter.cs
- CursorConverter.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- ScrollProperties.cs
- JulianCalendar.cs
- ClockGroup.cs
- Menu.cs
- PolyLineSegment.cs
- BaseServiceProvider.cs
- contentDescriptor.cs
- RelOps.cs
- OdbcEnvironmentHandle.cs
- UserCancellationException.cs
- DataControlFieldCollection.cs
- TransactedBatchingBehavior.cs
- CommandField.cs
- JsonEncodingStreamWrapper.cs
- Attributes.cs
- AuthenticationService.cs
- AttachedAnnotation.cs
- TablePatternIdentifiers.cs
- ExpandedWrapper.cs
- TemplateField.cs