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
- KeyPressEvent.cs
- _ProxyRegBlob.cs
- QuaternionConverter.cs
- EntityContainer.cs
- MediaTimeline.cs
- TemplateBuilder.cs
- UIElementParaClient.cs
- RuntimeEnvironment.cs
- PassportAuthenticationEventArgs.cs
- CompletionCallbackWrapper.cs
- DragDropHelper.cs
- HyperLinkStyle.cs
- ProjectionPruner.cs
- XmlDataDocument.cs
- TypeDependencyAttribute.cs
- TTSEngineTypes.cs
- DNS.cs
- IdentityNotMappedException.cs
- UpDownBase.cs
- ContractSearchPattern.cs
- ObjectStateFormatter.cs
- DrawListViewItemEventArgs.cs
- ReverseInheritProperty.cs
- ToolStripScrollButton.cs
- HttpDebugHandler.cs
- ScriptDescriptor.cs
- CounterSampleCalculator.cs
- CloseCollectionAsyncResult.cs
- AuthenticationConfig.cs
- BitVec.cs
- BitConverter.cs
- XpsS0ValidatingLoader.cs
- DictionaryEditChange.cs
- AdCreatedEventArgs.cs
- DoubleStorage.cs
- PenThread.cs
- RequestCacheManager.cs
- ArrayConverter.cs
- SafeRightsManagementEnvironmentHandle.cs
- DbConnectionPoolOptions.cs
- BinaryNode.cs
- OLEDB_Enum.cs
- FocusManager.cs
- TextureBrush.cs
- TreeNodeClickEventArgs.cs
- CompositeScriptReferenceEventArgs.cs
- ContextQuery.cs
- EdmItemError.cs
- _ConnectionGroup.cs
- WindowsRebar.cs
- XmlDataProvider.cs
- ConfigXmlComment.cs
- AnnotationComponentChooser.cs
- EntityParameter.cs
- MouseCaptureWithinProperty.cs
- ControlPaint.cs
- ServiceOperationParameter.cs
- TypedServiceOperationListItem.cs
- DataPagerCommandEventArgs.cs
- XmlToDatasetMap.cs
- UserPreferenceChangingEventArgs.cs
- WeakRefEnumerator.cs
- ModulesEntry.cs
- NumericExpr.cs
- JournalEntryStack.cs
- Point3D.cs
- CatalogPartDesigner.cs
- CustomLineCap.cs
- ProcessInfo.cs
- DefaultHttpHandler.cs
- EventRecord.cs
- AttributedMetaModel.cs
- SqlTrackingWorkflowInstance.cs
- RegexBoyerMoore.cs
- ScaleTransform.cs
- RuntimeConfig.cs
- InternalMappingException.cs
- ResXFileRef.cs
- WorkItem.cs
- DataGridViewHeaderCell.cs
- ProfileSection.cs
- NGCSerializer.cs
- _ListenerRequestStream.cs
- XmlDataLoader.cs
- TagNameToTypeMapper.cs
- SqlConnectionPoolProviderInfo.cs
- LineVisual.cs
- Blend.cs
- DocumentPageView.cs
- thaishape.cs
- ClientProxyGenerator.cs
- XamlUtilities.cs
- __ConsoleStream.cs
- LiteralControl.cs
- DateTimeOffset.cs
- BamlRecordHelper.cs
- NavigationProperty.cs
- ToolStripProgressBar.cs
- LambdaReference.cs
- ToolStripTextBox.cs