Sdílet prostřednictvím


XmlNamespaceManager.GetEnumerator Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns an enumerator to use to iterate through the namespaces in the XmlNamespaceManager.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

Syntax

'Declaration
Public Overridable Function GetEnumerator As IEnumerator
public virtual IEnumerator GetEnumerator()

Return Value

Type: System.Collections.IEnumerator
An IEnumerator containing the prefixes stored by the XmlNamespaceManager.

Implements

IEnumerable.GetEnumerator()

Remarks

The following code shows how to use the IEnumerator to view all the namespace pairs stored in the XmlNamespaceManager object.

Dim nsEnum As IEnumerator = nsmgr.GetEnumerator()
Do While nsEnum.MoveNext
  If nsEnum.Current <> "" Then
    OutputTextBlock.Text ="xmlns:" + nsEnum.Current + "=" + nsmgr.LookupNamespace(nsEnum.Current)
  End If
Loop

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.