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
- ping.cs
- DebugInfoGenerator.cs
- PartialArray.cs
- oledbmetadatacolumnnames.cs
- ByteStreamMessageEncodingElement.cs
- _ProxyChain.cs
- InlinedLocationReference.cs
- Keywords.cs
- SQLBytes.cs
- PageAdapter.cs
- EventLogPermissionEntry.cs
- CacheDependency.cs
- GridViewSelectEventArgs.cs
- DictionaryContent.cs
- Storyboard.cs
- DefaultHttpHandler.cs
- HyperLinkStyle.cs
- BrowserDefinitionCollection.cs
- Light.cs
- Tile.cs
- XmlCodeExporter.cs
- BlobPersonalizationState.cs
- Persist.cs
- ValuePatternIdentifiers.cs
- RowToFieldTransformer.cs
- InternalCache.cs
- FlowDocumentReaderAutomationPeer.cs
- XmlUnspecifiedAttribute.cs
- SqlDataSourceView.cs
- ScriptingWebServicesSectionGroup.cs
- XmlSchema.cs
- MoveSizeWinEventHandler.cs
- EntityAdapter.cs
- RecognizeCompletedEventArgs.cs
- Root.cs
- CompilerScopeManager.cs
- XmlEntityReference.cs
- ExtensionWindowHeader.cs
- Internal.cs
- CLSCompliantAttribute.cs
- SetStateEventArgs.cs
- XmlIgnoreAttribute.cs
- X509Chain.cs
- CodeAttributeDeclaration.cs
- FixedTextSelectionProcessor.cs
- Menu.cs
- TextEmbeddedObject.cs
- CancellationScope.cs
- DataGridViewCellValidatingEventArgs.cs
- UpdateCompiler.cs
- CustomErrorCollection.cs
- DbException.cs
- GacUtil.cs
- LayoutTableCell.cs
- RequestCachingSection.cs
- TabItem.cs
- GenericQueueSurrogate.cs
- WebPartDisplayMode.cs
- TextBoxAutoCompleteSourceConverter.cs
- LineProperties.cs
- RegexMatch.cs
- SkewTransform.cs
- HttpCapabilitiesEvaluator.cs
- ExcCanonicalXml.cs
- ImplicitInputBrush.cs
- FontInfo.cs
- QilFactory.cs
- SerialPort.cs
- DoubleCollectionConverter.cs
- CryptoApi.cs
- HttpServerUtilityWrapper.cs
- HelpInfo.cs
- KeyValuePairs.cs
- RenderTargetBitmap.cs
- SafeHGlobalHandleCritical.cs
- DataGridViewRowHeaderCell.cs
- AccessDataSource.cs
- DoubleMinMaxAggregationOperator.cs
- DependencyObjectPropertyDescriptor.cs
- DesignerForm.cs
- MissingFieldException.cs
- WebPartZone.cs
- WebExceptionStatus.cs
- SizeIndependentAnimationStorage.cs
- EditCommandColumn.cs
- SizeF.cs
- BufferedWebEventProvider.cs
- EdmComplexTypeAttribute.cs
- ScaleTransform3D.cs
- HttpCapabilitiesBase.cs
- WindowsStartMenu.cs
- ReverseQueryOperator.cs
- GifBitmapDecoder.cs
- GenericTypeParameterBuilder.cs
- SqlConnectionHelper.cs
- Thread.cs
- IItemProperties.cs
- SecurityPolicySection.cs
- TypeListConverter.cs
- EventTrigger.cs