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
- IntPtr.cs
- RequestCachePolicy.cs
- CompilationSection.cs
- SizeLimitedCache.cs
- OleDbDataAdapter.cs
- TextStore.cs
- PrtTicket_Public_Simple.cs
- OperationParameterInfo.cs
- ConfigurationPropertyCollection.cs
- IndentTextWriter.cs
- LocatorPart.cs
- OptimizerPatterns.cs
- FocusChangedEventArgs.cs
- OdbcDataAdapter.cs
- RuleSetBrowserDialog.cs
- TableRow.cs
- cache.cs
- RegexTypeEditor.cs
- AttributeTable.cs
- SelectionList.cs
- UInt16Storage.cs
- ObjectKeyFrameCollection.cs
- CodeAccessSecurityEngine.cs
- TypedElement.cs
- MenuEventArgs.cs
- OpenTypeLayout.cs
- PersonalizationProviderHelper.cs
- DescendantBaseQuery.cs
- FormsAuthenticationCredentials.cs
- SettingsContext.cs
- TextRangeAdaptor.cs
- TypeSystem.cs
- TypeConverterAttribute.cs
- VariableQuery.cs
- cookie.cs
- XmlSchemaObjectTable.cs
- UInt64Converter.cs
- Vector3D.cs
- Pkcs7Signer.cs
- DeviceContexts.cs
- AppDomainUnloadedException.cs
- DetailsViewCommandEventArgs.cs
- DataGridViewSortCompareEventArgs.cs
- ApplicationSecurityInfo.cs
- BuildManagerHost.cs
- MultiSelectRootGridEntry.cs
- XmlProcessingInstruction.cs
- DocumentGrid.cs
- QilPatternVisitor.cs
- AdapterUtil.cs
- RoleService.cs
- ValidationRule.cs
- LinqToSqlWrapper.cs
- MimePart.cs
- SuppressMergeCheckAttribute.cs
- objectresult_tresulttype.cs
- UnsafeNativeMethodsPenimc.cs
- CodeDelegateCreateExpression.cs
- DictionaryBase.cs
- XsltQilFactory.cs
- XAMLParseException.cs
- ReflectionServiceProvider.cs
- AsyncResult.cs
- BrowserDefinitionCollection.cs
- CommonObjectSecurity.cs
- RenderContext.cs
- PointCollectionConverter.cs
- _SslStream.cs
- ConstructorNeedsTagAttribute.cs
- EdmComplexPropertyAttribute.cs
- PatternMatcher.cs
- OrderPreservingMergeHelper.cs
- NavigationCommands.cs
- DictionaryCustomTypeDescriptor.cs
- XmlSchemaValidationException.cs
- PersonalizationState.cs
- RemotingConfigParser.cs
- WebPartConnectionsConfigureVerb.cs
- AddInActivator.cs
- SerializerWriterEventHandlers.cs
- PropertyConverter.cs
- EdmMember.cs
- COM2IDispatchConverter.cs
- Overlapped.cs
- SQLInt32Storage.cs
- ThreadStaticAttribute.cs
- CounterCreationDataCollection.cs
- Codec.cs
- FlowchartDesigner.xaml.cs
- LinkDescriptor.cs
- Transform3DGroup.cs
- Page.cs
- Binding.cs
- Transactions.cs
- TcpProcessProtocolHandler.cs
- PrintDialogException.cs
- BitmapInitialize.cs
- XslCompiledTransform.cs
- ProbeDuplex11AsyncResult.cs
- TraceLog.cs