Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- PrintingPermission.cs
- GiveFeedbackEventArgs.cs
- Knowncolors.cs
- QuinticEase.cs
- ButtonColumn.cs
- TextControlDesigner.cs
- UnmanagedMarshal.cs
- FullTextState.cs
- DrawingBrush.cs
- DisplayToken.cs
- OleDbTransaction.cs
- COM2Enum.cs
- processwaithandle.cs
- DesignerTextBoxAdapter.cs
- ListViewTableCell.cs
- Span.cs
- ConversionHelper.cs
- MenuItemStyleCollection.cs
- CodeNamespaceImportCollection.cs
- GifBitmapDecoder.cs
- SchemaImporterExtensionElement.cs
- CodeThrowExceptionStatement.cs
- CircleHotSpot.cs
- ProfileProvider.cs
- Listbox.cs
- BmpBitmapDecoder.cs
- HttpException.cs
- PersonalizationState.cs
- NonNullItemCollection.cs
- ObjectQueryExecutionPlan.cs
- RoleServiceManager.cs
- BasicKeyConstraint.cs
- QilSortKey.cs
- ThousandthOfEmRealDoubles.cs
- RuleAction.cs
- RijndaelManaged.cs
- StringWriter.cs
- IRCollection.cs
- Binding.cs
- SiteMapNodeCollection.cs
- SQLDateTime.cs
- PositiveTimeSpanValidator.cs
- UnsafeNetInfoNativeMethods.cs
- FieldNameLookup.cs
- BuildProvidersCompiler.cs
- FullTextState.cs
- ExtensionQuery.cs
- DATA_BLOB.cs
- CookieProtection.cs
- StyleCollection.cs
- CrossSiteScriptingValidation.cs
- WithStatement.cs
- DataGridItemCollection.cs
- PathParser.cs
- xamlnodes.cs
- SortableBindingList.cs
- NaturalLanguageHyphenator.cs
- CalendarDateRangeChangingEventArgs.cs
- _LoggingObject.cs
- DashStyles.cs
- util.cs
- MemberPath.cs
- AccessViolationException.cs
- CqlLexerHelpers.cs
- DataKeyArray.cs
- Util.cs
- SecurityState.cs
- DBSqlParserTableCollection.cs
- SchemaContext.cs
- ListViewInsertedEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- _KerberosClient.cs
- CodeValidator.cs
- DbConnectionClosed.cs
- DoubleUtil.cs
- MenuCommandsChangedEventArgs.cs
- MediaContextNotificationWindow.cs
- Quad.cs
- UnsafeNativeMethodsMilCoreApi.cs
- ComplexTypeEmitter.cs
- ReadOnlyDictionary.cs
- BufferModesCollection.cs
- ListViewTableCell.cs
- ParameterToken.cs
- TraceInternal.cs
- CellConstantDomain.cs
- PenThread.cs
- CodeDirectiveCollection.cs
- XmlDataCollection.cs
- _RequestCacheProtocol.cs
- FormViewRow.cs
- WindowsStatic.cs
- DataServiceKeyAttribute.cs
- ScrollableControlDesigner.cs
- EmptyEnumerable.cs
- MatrixKeyFrameCollection.cs
- StrongNameKeyPair.cs
- ProtocolsSection.cs
- LogLogRecordHeader.cs
- HTMLTextWriter.cs