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
- XmlSchemaSearchPattern.cs
- DoWorkEventArgs.cs
- WorkingDirectoryEditor.cs
- DebugTracing.cs
- PasswordBox.cs
- EntityContainerEmitter.cs
- DiscoveryViaBehavior.cs
- MetroSerializationManager.cs
- BrowserTree.cs
- COM2PropertyDescriptor.cs
- DataProtectionSecurityStateEncoder.cs
- FrameDimension.cs
- AssociatedControlConverter.cs
- TabItemWrapperAutomationPeer.cs
- DesigntimeLicenseContextSerializer.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- HatchBrush.cs
- RuleSettings.cs
- MessageDirection.cs
- DbConnectionStringCommon.cs
- AspNetCompatibilityRequirementsAttribute.cs
- SafeFileMappingHandle.cs
- LocatorPart.cs
- SQLInt16.cs
- ThrowOnMultipleAssignment.cs
- RelationshipConstraintValidator.cs
- FormsAuthenticationModule.cs
- DataGridViewCellConverter.cs
- ScrollContentPresenter.cs
- InstanceLockQueryResult.cs
- ListViewPagedDataSource.cs
- WebPartMenu.cs
- X509CertificateChain.cs
- GridItem.cs
- ActivityStatusChangeEventArgs.cs
- DataGridViewMethods.cs
- RecoverInstanceLocksCommand.cs
- StringStorage.cs
- BitmapSizeOptions.cs
- XmlException.cs
- SqlExpander.cs
- StringHandle.cs
- _DisconnectOverlappedAsyncResult.cs
- GroupBox.cs
- PersonalizationProvider.cs
- OdbcEnvironment.cs
- LayoutEditorPart.cs
- FileCodeGroup.cs
- GacUtil.cs
- RemotingAttributes.cs
- DefaultWorkflowSchedulerService.cs
- CodeAttributeArgument.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- Aes.cs
- PageThemeBuildProvider.cs
- PropertyDescriptorGridEntry.cs
- DispatcherHooks.cs
- UriTemplateQueryValue.cs
- WSSecureConversation.cs
- AuthorizationSection.cs
- SchemaEntity.cs
- WmpBitmapEncoder.cs
- ListViewItem.cs
- MenuItemBinding.cs
- DeviceContext.cs
- SecuritySessionServerSettings.cs
- BufferedGenericXmlSecurityToken.cs
- TextEncodedRawTextWriter.cs
- XmlException.cs
- PeerApplication.cs
- ContractHandle.cs
- FontResourceCache.cs
- OutOfMemoryException.cs
- CryptoHandle.cs
- FastEncoderStatics.cs
- RepeaterDesigner.cs
- NestPullup.cs
- PlainXmlDeserializer.cs
- DataDesignUtil.cs
- DrawListViewItemEventArgs.cs
- EntityDesignerBuildProvider.cs
- DbProviderSpecificTypePropertyAttribute.cs
- WebDescriptionAttribute.cs
- DiscreteKeyFrames.cs
- HandlerFactoryWrapper.cs
- XamlGridLengthSerializer.cs
- DisableDpiAwarenessAttribute.cs
- XmlSchemaSimpleContentExtension.cs
- ComponentConverter.cs
- EntityClientCacheEntry.cs
- ConfigXmlComment.cs
- CreateBookmarkScope.cs
- XamlBrushSerializer.cs
- FontWeight.cs
- ChannelSinkStacks.cs
- ProvideValueServiceProvider.cs
- FixUp.cs
- Vector3DAnimation.cs
- WindowsScroll.cs
- DataGridViewIntLinkedList.cs