XmlNamespaceManager.GetEnumerator XmlNamespaceManager.GetEnumerator XmlNamespaceManager.GetEnumerator XmlNamespaceManager.GetEnumerator Method

定義

傳回用於逐一查看 XmlNamespaceManager 中命名空間的列舉值。Returns an enumerator to use to iterate through the namespaces in the XmlNamespaceManager.

public:
 virtual System::Collections::IEnumerator ^ GetEnumerator();
public virtual System.Collections.IEnumerator GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Overridable Function GetEnumerator () As IEnumerator

傳回

IEnumerator,包含 XmlNamespaceManager 儲存的前置詞。An IEnumerator containing the prefixes stored by the XmlNamespaceManager.

實作

備註

下列程式碼示範如何使用IEnumerator來查看儲存XmlNamespaceManager在物件中的所有命名空間配對。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  
    MsgBox("xmlns:" + nsEnum.Current + "=" + nsmgr.LookupNamespace(nsEnum.Current))  
  End If  
Loop  

適用於

另請參閱