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
- ExtentCqlBlock.cs
- NavigationWindow.cs
- Point4DConverter.cs
- PageContentCollection.cs
- CreatingCookieEventArgs.cs
- DataGridItemEventArgs.cs
- BooleanSwitch.cs
- DocumentPageTextView.cs
- TextTreeDeleteContentUndoUnit.cs
- TreeViewItemAutomationPeer.cs
- RadioButton.cs
- FixedSchema.cs
- NoClickablePointException.cs
- WebServiceClientProxyGenerator.cs
- XmlSchemaAppInfo.cs
- DataTableCollection.cs
- RoleService.cs
- WorkflowViewStateService.cs
- DataGridViewCellValueEventArgs.cs
- LinkedResourceCollection.cs
- TableChangeProcessor.cs
- CfgRule.cs
- ObjectToIdCache.cs
- WebServiceErrorEvent.cs
- EndPoint.cs
- UserControl.cs
- BitmapCodecInfoInternal.cs
- DataGridTableCollection.cs
- SqlParameterCollection.cs
- SelectionPatternIdentifiers.cs
- NativeBuffer.cs
- Listbox.cs
- WsrmFault.cs
- PrincipalPermission.cs
- XmlAnyAttributeAttribute.cs
- xsdvalidator.cs
- StoreItemCollection.cs
- DataBindEngine.cs
- precedingquery.cs
- PageThemeCodeDomTreeGenerator.cs
- XPathNodeInfoAtom.cs
- DataGridState.cs
- MDIControlStrip.cs
- TextContainer.cs
- JavascriptCallbackMessageInspector.cs
- DrawingGroup.cs
- TextMessageEncodingBindingElement.cs
- BidPrivateBase.cs
- XmlSerializationWriter.cs
- MeasureData.cs
- Assembly.cs
- RelOps.cs
- TypeNameHelper.cs
- HttpDigestClientElement.cs
- HttpListenerElement.cs
- ProxyWebPart.cs
- Calendar.cs
- PersistenceMetadataNamespace.cs
- RequestResizeEvent.cs
- DbLambda.cs
- OleDbDataAdapter.cs
- CellPartitioner.cs
- InvalidPropValue.cs
- SoapSchemaMember.cs
- TdsParserStaticMethods.cs
- ToolStripDropDownClosingEventArgs.cs
- TransformConverter.cs
- XmlSchemaComplexType.cs
- Rotation3D.cs
- GridViewActionList.cs
- SchemaRegistration.cs
- StandardBindingReliableSessionElement.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- ConnectionStringsExpressionBuilder.cs
- IdentityNotMappedException.cs
- SafeCoTaskMem.cs
- WorkingDirectoryEditor.cs
- TraceShell.cs
- GCHandleCookieTable.cs
- CollaborationHelperFunctions.cs
- XmlNode.cs
- ReflectionUtil.cs
- PaperSource.cs
- MethodBuilderInstantiation.cs
- FormViewUpdatedEventArgs.cs
- ExpandoObject.cs
- UshortList2.cs
- WebDisplayNameAttribute.cs
- ExeConfigurationFileMap.cs
- JsonReader.cs
- XmlIncludeAttribute.cs
- EntitySqlQueryCacheEntry.cs
- DuplicateWaitObjectException.cs
- GridViewPageEventArgs.cs
- LoadedOrUnloadedOperation.cs
- TemplateField.cs
- QuaternionIndependentAnimationStorage.cs
- Size.cs
- CommandHelper.cs
- PreviewPageInfo.cs