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
- FormViewModeEventArgs.cs
- ScriptingSectionGroup.cs
- DataGridViewCellMouseEventArgs.cs
- ExpandSegment.cs
- WebPartRestoreVerb.cs
- AppendHelper.cs
- ContentFileHelper.cs
- ExtensionSimplifierMarkupObject.cs
- EntryPointNotFoundException.cs
- ModuleBuilderData.cs
- EdmItemCollection.cs
- XmlStreamStore.cs
- TextSelectionHighlightLayer.cs
- SafeMemoryMappedViewHandle.cs
- CodeDOMProvider.cs
- MappingModelBuildProvider.cs
- CopyNodeSetAction.cs
- WebPartZoneCollection.cs
- PropertyTabChangedEvent.cs
- MailBnfHelper.cs
- OracleRowUpdatedEventArgs.cs
- PeerEndPoint.cs
- PlatformNotSupportedException.cs
- StaticExtensionConverter.cs
- CompilationUtil.cs
- _ProxyChain.cs
- WeakEventManager.cs
- StructuralCache.cs
- M3DUtil.cs
- StrokeNodeOperations2.cs
- TextFragmentEngine.cs
- AttributeAction.cs
- XamlValidatingReader.cs
- ParserHooks.cs
- TraceRecord.cs
- XamlReaderHelper.cs
- ExpressionTable.cs
- DbDataSourceEnumerator.cs
- InstanceLockQueryResult.cs
- SessionSwitchEventArgs.cs
- MetadataSource.cs
- IndexedGlyphRun.cs
- EdmComplexTypeAttribute.cs
- XPathBinder.cs
- ToolStripSplitStackLayout.cs
- MsmqHostedTransportConfiguration.cs
- RuleRef.cs
- PageParser.cs
- SubclassTypeValidator.cs
- DataGridHelper.cs
- CultureInfo.cs
- _UriSyntax.cs
- OleDbFactory.cs
- ReceiveSecurityHeader.cs
- SerializationEventsCache.cs
- PropertyValueEditor.cs
- HttpModuleAction.cs
- AnnotationComponentChooser.cs
- RectAnimationUsingKeyFrames.cs
- RequestTimeoutManager.cs
- COAUTHINFO.cs
- VersionPair.cs
- NegotiationTokenAuthenticatorState.cs
- StylusEventArgs.cs
- XmlSignificantWhitespace.cs
- CachedCompositeFamily.cs
- FilterException.cs
- SqlTriggerAttribute.cs
- While.cs
- DoubleMinMaxAggregationOperator.cs
- DataControlLinkButton.cs
- httpserverutility.cs
- DBSqlParserTableCollection.cs
- Span.cs
- StrokeNodeData.cs
- ViewManager.cs
- Convert.cs
- StackOverflowException.cs
- PropertyDescriptorCollection.cs
- formatter.cs
- DocumentViewerHelper.cs
- RSAPKCS1SignatureDeformatter.cs
- SequentialWorkflowHeaderFooter.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- _BufferOffsetSize.cs
- GenericTypeParameterConverter.cs
- MemberExpressionHelper.cs
- StoryFragments.cs
- EventMappingSettings.cs
- RepeaterItemCollection.cs
- UIElement.cs
- httpstaticobjectscollection.cs
- ReadOnlyCollectionBase.cs
- BevelBitmapEffect.cs
- EventTrigger.cs
- SchemaEntity.cs
- HierarchicalDataBoundControlAdapter.cs
- ListItemCollection.cs
- BamlRecordWriter.cs
- ElementInit.cs