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
- Bidi.cs
- AttributeEmitter.cs
- ListViewTableCell.cs
- Column.cs
- DateTimeValueSerializer.cs
- XsltConvert.cs
- GreenMethods.cs
- RSAOAEPKeyExchangeDeformatter.cs
- CompiledIdentityConstraint.cs
- ObjectCloneHelper.cs
- TextTreeInsertUndoUnit.cs
- XmlSchemaAttributeGroupRef.cs
- EntityDataSource.cs
- DefaultValidator.cs
- SchemaType.cs
- StringDictionaryCodeDomSerializer.cs
- DoubleAverageAggregationOperator.cs
- DiscriminatorMap.cs
- MatrixTransform.cs
- RichTextBox.cs
- SqlCacheDependencySection.cs
- Parameter.cs
- XNameConverter.cs
- FrameworkContextData.cs
- KeyedHashAlgorithm.cs
- EntityContainerAssociationSetEnd.cs
- InvalidCastException.cs
- SizeAnimation.cs
- ClientFormsAuthenticationMembershipProvider.cs
- ResourceReferenceKeyNotFoundException.cs
- SerializerWriterEventHandlers.cs
- BitmapData.cs
- ValidationErrorCollection.cs
- QuerySelectOp.cs
- StrongName.cs
- ForeignConstraint.cs
- QilGenerator.cs
- ToolStripControlHost.cs
- IsolatedStorageFileStream.cs
- ListViewUpdatedEventArgs.cs
- RequestSecurityToken.cs
- NullableIntAverageAggregationOperator.cs
- _NestedSingleAsyncResult.cs
- TextRunProperties.cs
- RowVisual.cs
- Activity.cs
- MaterializeFromAtom.cs
- SqlProviderServices.cs
- SapiInterop.cs
- TextServicesContext.cs
- xmlfixedPageInfo.cs
- CryptoHandle.cs
- DataSet.cs
- ObjectDataProvider.cs
- DynamicPropertyReader.cs
- WinEventHandler.cs
- Material.cs
- ZipIOLocalFileBlock.cs
- UpdatePanelControlTrigger.cs
- PropertyDescriptorCollection.cs
- CompilerWrapper.cs
- StateMachineWorkflowDesigner.cs
- HelpEvent.cs
- StylusPlugin.cs
- RawStylusInput.cs
- TableStyle.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- SafePipeHandle.cs
- ListenerChannelContext.cs
- StringUtil.cs
- Header.cs
- ConnectionStringsSection.cs
- VariableExpressionConverter.cs
- filewebrequest.cs
- PaintValueEventArgs.cs
- TextStore.cs
- SchemaInfo.cs
- RotationValidation.cs
- ManagementScope.cs
- MdImport.cs
- ButtonRenderer.cs
- SlotInfo.cs
- ToolstripProfessionalRenderer.cs
- ListViewGroupCollectionEditor.cs
- Typography.cs
- CompilerErrorCollection.cs
- TaskFileService.cs
- SkinBuilder.cs
- SingleKeyFrameCollection.cs
- GridViewUpdatedEventArgs.cs
- AnnouncementInnerClientCD1.cs
- Aggregates.cs
- FileDetails.cs
- MatchingStyle.cs
- SamlAuthenticationClaimResource.cs
- DataGridViewRow.cs
- CompoundFileIOPermission.cs
- UnitySerializationHolder.cs
- AddInSegmentDirectoryNotFoundException.cs
- HtmlAnchor.cs