Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SortDescription.cs
- IIS7WorkerRequest.cs
- MemoryResponseElement.cs
- View.cs
- UnionCqlBlock.cs
- NGCSerializationManagerAsync.cs
- ImageDrawing.cs
- DummyDataSource.cs
- objectquery_tresulttype.cs
- PrimarySelectionGlyph.cs
- StorageTypeMapping.cs
- QueryOptionExpression.cs
- IndexedDataBuffer.cs
- XmlStringTable.cs
- BooleanAnimationBase.cs
- HtmlInputButton.cs
- BoolExpressionVisitors.cs
- AppDomainAttributes.cs
- ToolStripKeyboardHandlingService.cs
- HtmlInputFile.cs
- TextBoxLine.cs
- TraceSwitch.cs
- SelectionListDesigner.cs
- UnsafeNativeMethods.cs
- SortedDictionary.cs
- FloaterParaClient.cs
- versioninfo.cs
- SymmetricAlgorithm.cs
- HtmlDocument.cs
- BamlBinaryReader.cs
- FromRequest.cs
- Blend.cs
- QualifiedCellIdBoolean.cs
- GroupByExpressionRewriter.cs
- Menu.cs
- StringComparer.cs
- UrlRoutingModule.cs
- PointConverter.cs
- TemplateBindingExpressionConverter.cs
- HandledEventArgs.cs
- BindableAttribute.cs
- _HeaderInfo.cs
- IncrementalCompileAnalyzer.cs
- BaseTemplateBuildProvider.cs
- CodeEntryPointMethod.cs
- GlyphRunDrawing.cs
- TranslateTransform.cs
- DesignerSelectionListAdapter.cs
- ModuleElement.cs
- BamlLocalizabilityResolver.cs
- MarshalDirectiveException.cs
- EditorZoneBase.cs
- DataPointer.cs
- ResXResourceWriter.cs
- SQLInt64Storage.cs
- LayoutInformation.cs
- SessionParameter.cs
- Publisher.cs
- XmlValidatingReader.cs
- TypedTableBaseExtensions.cs
- MenuEventArgs.cs
- WebPartTransformerCollection.cs
- DataGridViewControlCollection.cs
- MexServiceChannelBuilder.cs
- TcpTransportElement.cs
- TemplatedMailWebEventProvider.cs
- SecurityTokenAuthenticator.cs
- DataGridDetailsPresenter.cs
- SchemaType.cs
- HitTestDrawingContextWalker.cs
- RightsManagementErrorHandler.cs
- Model3D.cs
- MissingMethodException.cs
- SystemGatewayIPAddressInformation.cs
- DataListComponentEditor.cs
- datacache.cs
- TransformedBitmap.cs
- ReachSerializationCacheItems.cs
- LicenseException.cs
- XmlDictionaryReaderQuotas.cs
- DesignerAttribute.cs
- WorkflowQueueInfo.cs
- WindowsListViewGroup.cs
- RemotingConfigParser.cs
- PrintDialog.cs
- RequestCacheEntry.cs
- CLSCompliantAttribute.cs
- CheckoutException.cs
- DataGridColumnHeaderCollection.cs
- PackUriHelper.cs
- GradientStop.cs
- Path.cs
- PipeStream.cs
- ContentPlaceHolderDesigner.cs
- GridViewCellAutomationPeer.cs
- RbTree.cs
- DetailsViewDeletedEventArgs.cs
- SqlConnectionHelper.cs
- _OverlappedAsyncResult.cs
- ActivityLocationReferenceEnvironment.cs