Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / schema / SchemaNamespaceManager.cs / 1305376 / 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
- ReadOnlyCollectionBuilder.cs
- ProviderConnectionPointCollection.cs
- SessionStateUtil.cs
- BackgroundFormatInfo.cs
- UInt32.cs
- HandlerBase.cs
- ProtectedProviderSettings.cs
- Utility.cs
- StrongNameUtility.cs
- IntSecurity.cs
- DataSourceExpression.cs
- DrawingServices.cs
- CodeTypeDeclaration.cs
- MissingMethodException.cs
- OpCellTreeNode.cs
- Number.cs
- HierarchicalDataSourceDesigner.cs
- MimeBasePart.cs
- SimpleTypeResolver.cs
- SafeFileMappingHandle.cs
- StateMachineWorkflow.cs
- ExpressionBindingCollection.cs
- ConfigurationSectionGroupCollection.cs
- NamespaceCollection.cs
- SafeLocalAllocation.cs
- ObjectMemberMapping.cs
- AssemblyAssociatedContentFileAttribute.cs
- HeaderUtility.cs
- DATA_BLOB.cs
- ObjectDesignerDataSourceView.cs
- TextEditorSelection.cs
- IgnoreFileBuildProvider.cs
- RbTree.cs
- Animatable.cs
- ECDiffieHellmanPublicKey.cs
- BinaryParser.cs
- ListChangedEventArgs.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- DefaultTraceListener.cs
- TableCellAutomationPeer.cs
- NavigationWindowAutomationPeer.cs
- EntityKey.cs
- LoginAutoFormat.cs
- ApplicationProxyInternal.cs
- ScriptingWebServicesSectionGroup.cs
- precedingsibling.cs
- InterleavedZipPartStream.cs
- SymbolPair.cs
- UpDownBase.cs
- Random.cs
- SecurityException.cs
- HandlerWithFactory.cs
- WebConfigurationManager.cs
- EventLogPermission.cs
- columnmapfactory.cs
- Link.cs
- PipelineModuleStepContainer.cs
- XD.cs
- ObsoleteAttribute.cs
- Triplet.cs
- BamlLocalizer.cs
- Privilege.cs
- DateTimePicker.cs
- MachineKeySection.cs
- PrintController.cs
- xml.cs
- CodeTypeParameter.cs
- LicenseContext.cs
- ListControlConvertEventArgs.cs
- DataFieldCollectionEditor.cs
- XhtmlBasicSelectionListAdapter.cs
- login.cs
- DataFormats.cs
- UnderstoodHeaders.cs
- SymmetricSecurityProtocol.cs
- PrintPreviewDialog.cs
- UxThemeWrapper.cs
- ZeroOpNode.cs
- WebPartConnectionsConnectVerb.cs
- StyleXamlParser.cs
- ZoneButton.cs
- HtmlElementCollection.cs
- MobileListItemCollection.cs
- CodeAttachEventStatement.cs
- ColumnWidthChangingEvent.cs
- PolicyUnit.cs
- ControlBindingsCollection.cs
- PresentationTraceSources.cs
- LocalizableAttribute.cs
- FormViewDeletedEventArgs.cs
- DefaultWorkflowLoaderService.cs
- SolidBrush.cs
- SqlNode.cs
- SyndicationDeserializer.cs
- PageThemeCodeDomTreeGenerator.cs
- CellParagraph.cs
- HttpApplicationStateBase.cs
- DataTableNewRowEvent.cs
- SequenceQuery.cs
- ActionFrame.cs