Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ViewSimplifier.cs
- NativeRecognizer.cs
- CollectionBuilder.cs
- FormsAuthenticationEventArgs.cs
- Scene3D.cs
- QueryContinueDragEventArgs.cs
- ZoneIdentityPermission.cs
- ColorConverter.cs
- NavigationProgressEventArgs.cs
- TextViewBase.cs
- ImagingCache.cs
- AuthorizationSection.cs
- RealizedColumnsBlock.cs
- columnmapfactory.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- mactripleDES.cs
- rsa.cs
- SoapElementAttribute.cs
- ConfigWriter.cs
- ImageClickEventArgs.cs
- ScrollBarAutomationPeer.cs
- UserPersonalizationStateInfo.cs
- HtmlTableCellCollection.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- CheckedListBox.cs
- invalidudtexception.cs
- ToggleButton.cs
- ProcessHostFactoryHelper.cs
- SignatureHelper.cs
- BaseCollection.cs
- XmlParserContext.cs
- SqlCommandSet.cs
- ListBindableAttribute.cs
- ClonableStack.cs
- SHA1CryptoServiceProvider.cs
- Rect.cs
- PerformanceCountersBase.cs
- MatcherBuilder.cs
- DefinitionBase.cs
- ClientSection.cs
- ArraySortHelper.cs
- MemberPathMap.cs
- UnmanagedMarshal.cs
- ConnectionStringsSection.cs
- ProviderConnectionPoint.cs
- LinkLabelLinkClickedEvent.cs
- Tablet.cs
- LeftCellWrapper.cs
- DataGridHelper.cs
- IEnumerable.cs
- Publisher.cs
- MasterPageCodeDomTreeGenerator.cs
- Setter.cs
- MsmqIntegrationOutputChannel.cs
- XmlReader.cs
- FontNameConverter.cs
- MessageSmuggler.cs
- CodeMemberMethod.cs
- FrameDimension.cs
- FontUnit.cs
- StickyNoteContentControl.cs
- COM2FontConverter.cs
- SchemaCollectionCompiler.cs
- QualifiedCellIdBoolean.cs
- ZoomPercentageConverter.cs
- ScriptManagerProxy.cs
- XmlSchemaAppInfo.cs
- Int32.cs
- XmlSchemaValidationException.cs
- InvalidAsynchronousStateException.cs
- ItemAutomationPeer.cs
- SplitterPanel.cs
- RouteParametersHelper.cs
- GenericXmlSecurityToken.cs
- LoopExpression.cs
- AdornerPresentationContext.cs
- OdbcError.cs
- IsolatedStorageException.cs
- DrawItemEvent.cs
- FixedLineResult.cs
- DockingAttribute.cs
- WindowsTokenRoleProvider.cs
- ProviderException.cs
- JoinElimination.cs
- KeyInterop.cs
- DetailsViewPagerRow.cs
- DoubleCollectionValueSerializer.cs
- Compensation.cs
- WebBrowser.cs
- NodeCounter.cs
- Debug.cs
- BackgroundWorker.cs
- List.cs
- ViewManagerAttribute.cs
- DownloadProgressEventArgs.cs
- WrappedIUnknown.cs
- graph.cs
- ListGeneralPage.cs
- InstalledFontCollection.cs
- XmlSchemaAttributeGroup.cs