Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- EmptyReadOnlyDictionaryInternal.cs
- X509AsymmetricSecurityKey.cs
- MethodBody.cs
- RemoveStoryboard.cs
- FrameworkTemplate.cs
- AssemblyFilter.cs
- AutomationProperty.cs
- ellipse.cs
- TemplateBamlRecordReader.cs
- WindowsScroll.cs
- ZipIORawDataFileBlock.cs
- CompoundFileStreamReference.cs
- ValueUnavailableException.cs
- ImageDrawing.cs
- MatchingStyle.cs
- PassportAuthenticationModule.cs
- TrackingProfileSerializer.cs
- MatchingStyle.cs
- ExpressionBindingCollection.cs
- PopupRootAutomationPeer.cs
- ExceptionUtil.cs
- MarkerProperties.cs
- TrackBar.cs
- SecurityImpersonationBehavior.cs
- WindowsRegion.cs
- NonBatchDirectoryCompiler.cs
- ADMembershipProvider.cs
- IpcServerChannel.cs
- TextParaClient.cs
- EventLogInformation.cs
- GeometryValueSerializer.cs
- JsonReaderWriterFactory.cs
- WasHttpModulesInstallComponent.cs
- FlatButtonAppearance.cs
- XmlNodeList.cs
- SvcMapFileSerializer.cs
- ButtonField.cs
- RequestQueue.cs
- XamlToRtfWriter.cs
- PrivilegeNotHeldException.cs
- _CommandStream.cs
- HashHelper.cs
- SQLInt64Storage.cs
- XmlSchemaSequence.cs
- AssertSection.cs
- DataGridBoolColumn.cs
- VisualBasicSettings.cs
- VisualStates.cs
- LoadItemsEventArgs.cs
- DefaultValueConverter.cs
- MDIClient.cs
- ArglessEventHandlerProxy.cs
- WebCategoryAttribute.cs
- SamlNameIdentifierClaimResource.cs
- CodeMemberEvent.cs
- CurrentTimeZone.cs
- SecurityTokenProviderContainer.cs
- State.cs
- DateTimeOffset.cs
- EUCJPEncoding.cs
- IItemContainerGenerator.cs
- MembershipPasswordException.cs
- DataMisalignedException.cs
- MemberInfoSerializationHolder.cs
- Sql8ExpressionRewriter.cs
- WriteTimeStream.cs
- ToolStripManager.cs
- ResXResourceSet.cs
- DBPropSet.cs
- xsdvalidator.cs
- TdsParserHelperClasses.cs
- StateBag.cs
- WebPartCollection.cs
- Calendar.cs
- ExpressionBuilder.cs
- WebConfigurationHostFileChange.cs
- SpanIndex.cs
- TableSectionStyle.cs
- MenuCommand.cs
- Int64AnimationUsingKeyFrames.cs
- DBConnectionString.cs
- XhtmlTextWriter.cs
- OleDbRowUpdatedEvent.cs
- QueryOptionExpression.cs
- AttachedAnnotation.cs
- EllipseGeometry.cs
- WebPartAddingEventArgs.cs
- SecurityTokenProviderContainer.cs
- SMSvcHost.cs
- DesignerSelectionListAdapter.cs
- TextAdaptor.cs
- SqlNotificationEventArgs.cs
- DecoderFallbackWithFailureFlag.cs
- COM2Enum.cs
- ResourceSet.cs
- TableLayoutSettingsTypeConverter.cs
- FrameworkContentElementAutomationPeer.cs
- DateTimePickerDesigner.cs
- SimpleTextLine.cs
- DataGridViewButtonColumn.cs