Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / schema / SchemaNamespaceManager.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LineVisual.cs
- CqlLexerHelpers.cs
- LogFlushAsyncResult.cs
- CatalogPartChrome.cs
- ChameleonKey.cs
- NetSectionGroup.cs
- BulletChrome.cs
- SpeechEvent.cs
- MeshGeometry3D.cs
- SchemaEntity.cs
- ReliableMessagingHelpers.cs
- XpsThumbnail.cs
- TextRangeProviderWrapper.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- WebServiceClientProxyGenerator.cs
- LocalizableAttribute.cs
- EpmSyndicationContentSerializer.cs
- AuthenticationSchemesHelper.cs
- DbParameterHelper.cs
- UnsafeNativeMethods.cs
- MemberInfoSerializationHolder.cs
- ToolStripRendererSwitcher.cs
- DataViewSetting.cs
- DataViewManagerListItemTypeDescriptor.cs
- ManipulationDevice.cs
- ReferenceConverter.cs
- PlanCompilerUtil.cs
- UDPClient.cs
- RelationshipDetailsRow.cs
- DataGridRelationshipRow.cs
- Geometry.cs
- TextRangeBase.cs
- CodeStatementCollection.cs
- SafeHandles.cs
- SystemWebCachingSectionGroup.cs
- UpDownBaseDesigner.cs
- PinnedBufferMemoryStream.cs
- ArglessEventHandlerProxy.cs
- StorageScalarPropertyMapping.cs
- HttpDictionary.cs
- HistoryEventArgs.cs
- DataRowView.cs
- MatrixCamera.cs
- ActivityInfo.cs
- DispatcherHooks.cs
- DispatcherEventArgs.cs
- Stylesheet.cs
- XComponentModel.cs
- MultilineStringConverter.cs
- AnnotationStore.cs
- ComboBoxAutomationPeer.cs
- GraphicsContext.cs
- VBCodeProvider.cs
- ImageFormatConverter.cs
- WebBrowserNavigatedEventHandler.cs
- HebrewNumber.cs
- DragStartedEventArgs.cs
- RTLAwareMessageBox.cs
- NavigationCommands.cs
- HealthMonitoringSection.cs
- VerificationAttribute.cs
- ScopeElementCollection.cs
- CodeTypeMember.cs
- TextSelectionHelper.cs
- StringAnimationUsingKeyFrames.cs
- Rect.cs
- StoryFragments.cs
- CacheVirtualItemsEvent.cs
- Size.cs
- BinHexDecoder.cs
- UniqueIdentifierService.cs
- RotateTransform.cs
- NavigationEventArgs.cs
- XmlCompatibilityReader.cs
- ImageConverter.cs
- MatrixCamera.cs
- EncryptedKey.cs
- FontInfo.cs
- SoapException.cs
- CFStream.cs
- IgnoreSectionHandler.cs
- securitycriticaldata.cs
- AssociationProvider.cs
- XmlAttributeAttribute.cs
- dataprotectionpermissionattribute.cs
- SqlClientPermission.cs
- TableCellAutomationPeer.cs
- GeneratedView.cs
- PartialTrustVisibleAssemblyCollection.cs
- TextReader.cs
- SoapEnvelopeProcessingElement.cs
- FixedFlowMap.cs
- FileDialogCustomPlacesCollection.cs
- TypeDescriptor.cs
- XmlBindingWorker.cs
- ConnectionManagementElement.cs
- GridItemPatternIdentifiers.cs
- UserPersonalizationStateInfo.cs
- XsltCompileContext.cs
- Publisher.cs