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
- TextWriterTraceListener.cs
- CheckBoxField.cs
- UnsafeNativeMethodsCLR.cs
- SystemIcmpV4Statistics.cs
- TableDetailsCollection.cs
- EffectiveValueEntry.cs
- COM2Enum.cs
- CompilerLocalReference.cs
- Axis.cs
- BitmapEffect.cs
- RowToParametersTransformer.cs
- PeerTransportBindingElement.cs
- GridViewColumn.cs
- UrlMappingsModule.cs
- IFlowDocumentViewer.cs
- WmlListAdapter.cs
- arabicshape.cs
- CheckBoxBaseAdapter.cs
- SystemInfo.cs
- ResourceDisplayNameAttribute.cs
- HttpListenerContext.cs
- TdsParserStaticMethods.cs
- CompiledIdentityConstraint.cs
- DriveNotFoundException.cs
- WindowsAuthenticationEventArgs.cs
- PersonalizableAttribute.cs
- FormatConvertedBitmap.cs
- OledbConnectionStringbuilder.cs
- HwndSourceKeyboardInputSite.cs
- shaper.cs
- webclient.cs
- srgsitem.cs
- MetadataSerializer.cs
- XAMLParseException.cs
- CompilerHelpers.cs
- IndependentAnimationStorage.cs
- QueueProcessor.cs
- BmpBitmapEncoder.cs
- SchemeSettingElementCollection.cs
- XmlSchemaAttributeGroupRef.cs
- ClientConfigurationSystem.cs
- HtmlControlDesigner.cs
- EdmSchemaAttribute.cs
- httpstaticobjectscollection.cs
- ReflectTypeDescriptionProvider.cs
- Point3DCollectionValueSerializer.cs
- EventWaitHandle.cs
- XPathSelfQuery.cs
- RSAProtectedConfigurationProvider.cs
- ChangeConflicts.cs
- ProtocolsConfigurationHandler.cs
- MarginCollapsingState.cs
- TemplateLookupAction.cs
- CapabilitiesRule.cs
- FixedDSBuilder.cs
- GiveFeedbackEventArgs.cs
- DiscoveryClientReferences.cs
- TraceLog.cs
- ExtendedProtectionPolicyElement.cs
- MsmqInputChannelListenerBase.cs
- MergeLocalizationDirectives.cs
- RevocationPoint.cs
- LongMinMaxAggregationOperator.cs
- Camera.cs
- TransformerInfoCollection.cs
- DecimalAnimationUsingKeyFrames.cs
- Vector3DConverter.cs
- DataGridViewTopRowAccessibleObject.cs
- MobileResource.cs
- ToolStripOverflowButton.cs
- Int32CollectionValueSerializer.cs
- DesignerDeviceConfig.cs
- CacheChildrenQuery.cs
- ServiceEndpointCollection.cs
- AssemblyAttributesGoHere.cs
- UpdateExpressionVisitor.cs
- MouseEventArgs.cs
- ConstrainedDataObject.cs
- InputLangChangeEvent.cs
- NavigationPropertyEmitter.cs
- ComAdminInterfaces.cs
- AuthenticationConfig.cs
- XmlSchemaDocumentation.cs
- SortedList.cs
- BrowserCapabilitiesCompiler.cs
- XmlAttributeCache.cs
- NumericUpDown.cs
- OdbcTransaction.cs
- InfoCardProofToken.cs
- MetadataItemCollectionFactory.cs
- FormatException.cs
- TracingConnectionInitiator.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ObjectSpanRewriter.cs
- MemberMaps.cs
- ApplicationProxyInternal.cs
- MasterPageParser.cs
- CallbackHandler.cs
- ProtocolViolationException.cs
- MaskedTextBox.cs