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
- DirectoryObjectSecurity.cs
- AutoGeneratedFieldProperties.cs
- DataDocumentXPathNavigator.cs
- Validator.cs
- lengthconverter.cs
- StringWriter.cs
- StrokeNodeOperations.cs
- PropertyReferenceExtension.cs
- BinaryUtilClasses.cs
- ExpanderAutomationPeer.cs
- WindowsEditBoxRange.cs
- NotImplementedException.cs
- FormClosingEvent.cs
- Mappings.cs
- MaterializeFromAtom.cs
- DataSvcMapFile.cs
- SimpleHandlerFactory.cs
- GridViewColumn.cs
- ColumnResizeAdorner.cs
- FileDialog_Vista.cs
- TogglePatternIdentifiers.cs
- arc.cs
- DescendantBaseQuery.cs
- UIElement3D.cs
- VoiceInfo.cs
- SendMailErrorEventArgs.cs
- IisTraceListener.cs
- Geometry.cs
- PropertiesTab.cs
- StringWriter.cs
- IImplicitResourceProvider.cs
- PropagationProtocolsTracing.cs
- UnsafeNativeMethods.cs
- CodeCatchClauseCollection.cs
- ResourceType.cs
- ImageSourceValueSerializer.cs
- ping.cs
- BaseValidatorDesigner.cs
- Section.cs
- ExtentCqlBlock.cs
- Stroke2.cs
- QueryPageSettingsEventArgs.cs
- DataGridViewBindingCompleteEventArgs.cs
- NetPeerTcpBinding.cs
- BasicCellRelation.cs
- AnnouncementService.cs
- Byte.cs
- SoapSchemaMember.cs
- DataGridTemplateColumn.cs
- ParagraphVisual.cs
- SqlRowUpdatedEvent.cs
- Matrix.cs
- RegisteredExpandoAttribute.cs
- FileDialogCustomPlace.cs
- OdbcHandle.cs
- UITypeEditor.cs
- DataRecord.cs
- GACIdentityPermission.cs
- CachedFontFace.cs
- Margins.cs
- SolidBrush.cs
- InputScope.cs
- MbpInfo.cs
- SoapTypeAttribute.cs
- WmlLinkAdapter.cs
- OpenTypeLayout.cs
- ArrangedElementCollection.cs
- FirewallWrapper.cs
- EntityCommandCompilationException.cs
- EntityDataSourceChangingEventArgs.cs
- _HelperAsyncResults.cs
- TypeDescriptionProviderAttribute.cs
- ReadOnlyDataSourceView.cs
- Boolean.cs
- CngAlgorithm.cs
- ExpressionEditorAttribute.cs
- CaseExpr.cs
- ObjectListField.cs
- TextPointerBase.cs
- DataGridAutoFormat.cs
- CDSCollectionETWBCLProvider.cs
- DuplicateWaitObjectException.cs
- FontStyles.cs
- BooleanFunctions.cs
- Substitution.cs
- ExtendedProperty.cs
- IdnMapping.cs
- ComponentDesigner.cs
- WebPartConnectionsCancelEventArgs.cs
- DropDownList.cs
- ActionItem.cs
- PointIndependentAnimationStorage.cs
- XmlHierarchicalDataSourceView.cs
- InputMethod.cs
- SafeRegistryHandle.cs
- Point3D.cs
- MessageRpc.cs
- NameTable.cs
- ExceptionValidationRule.cs
- HierarchicalDataTemplate.cs