Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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
- PtsHelper.cs
- UserValidatedEventArgs.cs
- _NegoStream.cs
- DataDesignUtil.cs
- MetadataUtilsSmi.cs
- ToolConsole.cs
- DataGridParentRows.cs
- WebPartRestoreVerb.cs
- ActivityDesignerLayoutSerializers.cs
- FileAuthorizationModule.cs
- WebReferencesBuildProvider.cs
- RequestUriProcessor.cs
- StringResourceManager.cs
- DesignerSerializerAttribute.cs
- DbResourceAllocator.cs
- LayoutTableCell.cs
- JapaneseLunisolarCalendar.cs
- MSAAWinEventWrap.cs
- HttpPostLocalhostServerProtocol.cs
- Code.cs
- WebPartPersonalization.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Globals.cs
- ConnectionProviderAttribute.cs
- OleCmdHelper.cs
- COSERVERINFO.cs
- ClaimTypes.cs
- InputBuffer.cs
- EntityProxyFactory.cs
- CapabilitiesState.cs
- ClientScriptItemCollection.cs
- RC2CryptoServiceProvider.cs
- SortExpressionBuilder.cs
- UriExt.cs
- HandledEventArgs.cs
- HttpModuleCollection.cs
- CodeTypeMember.cs
- DefaultMemberAttribute.cs
- XmlDocumentViewSchema.cs
- _TimerThread.cs
- EpmCustomContentDeSerializer.cs
- TableParagraph.cs
- WizardPanelChangingEventArgs.cs
- SlotInfo.cs
- SafeReversePInvokeHandle.cs
- ControlBuilder.cs
- ToolStripDropDownClosedEventArgs.cs
- NamespaceListProperty.cs
- TransformGroup.cs
- UIntPtr.cs
- PingReply.cs
- Random.cs
- SelectedDatesCollection.cs
- InputLanguageCollection.cs
- SqlDataSourceSelectingEventArgs.cs
- XmlILTrace.cs
- Ray3DHitTestResult.cs
- QilInvoke.cs
- ClientProtocol.cs
- KnownBoxes.cs
- WSTrustDec2005.cs
- DataGridViewDataConnection.cs
- IsolatedStoragePermission.cs
- SingleKeyFrameCollection.cs
- BookmarkScopeManager.cs
- ReadOnlyNameValueCollection.cs
- Behavior.cs
- UInt16Storage.cs
- ReadWriteSpinLock.cs
- StringStorage.cs
- IdentifierCollection.cs
- ImageDrawing.cs
- ReflectPropertyDescriptor.cs
- WebControlAdapter.cs
- Utils.cs
- translator.cs
- columnmapfactory.cs
- LicenseManager.cs
- DataGridViewBand.cs
- SafeNativeMethods.cs
- CheckBoxBaseAdapter.cs
- ProcessThreadCollection.cs
- XmlSchemaSet.cs
- PipelineModuleStepContainer.cs
- ValidationErrorCollection.cs
- FloaterBaseParaClient.cs
- HMACSHA512.cs
- SpeakCompletedEventArgs.cs
- TextRangeEditLists.cs
- TimersDescriptionAttribute.cs
- initElementDictionary.cs
- DecimalConstantAttribute.cs
- EntityStoreSchemaFilterEntry.cs
- BCryptSafeHandles.cs
- StreamReader.cs
- UserInitiatedNavigationPermission.cs
- URLIdentityPermission.cs
- StorageEntitySetMapping.cs
- HttpServerChannel.cs
- UInt16.cs