共用方式為


Evidence.GetEnumerator 方法

定義

警告

GetEnumerator is obsolete. Use GetAssemblyEnumerator and GetHostEnumerator instead.

警告

GetEnumerator is obsolete. Please use GetAssemblyEnumerator and GetHostEnumerator instead.

警告

此 API 現已淘汰。

列舉集合中所有由主應用程式和組件提供的辨識碼。

public:
 virtual System::Collections::IEnumerator ^ GetEnumerator();
[System.Obsolete("GetEnumerator is obsolete. Use GetAssemblyEnumerator and GetHostEnumerator instead.")]
public System.Collections.IEnumerator GetEnumerator ();
public System.Collections.IEnumerator GetEnumerator ();
[System.Obsolete("GetEnumerator is obsolete. Please use GetAssemblyEnumerator and GetHostEnumerator instead.")]
public System.Collections.IEnumerator GetEnumerator ();
[System.Obsolete]
public System.Collections.IEnumerator GetEnumerator ();
[<System.Obsolete("GetEnumerator is obsolete. Use GetAssemblyEnumerator and GetHostEnumerator instead.")>]
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
[<System.Obsolete("GetEnumerator is obsolete. Please use GetAssemblyEnumerator and GetHostEnumerator instead.")>]
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
[<System.Obsolete>]
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Function GetEnumerator () As IEnumerator

傳回

辨識碼列舉值,由 AddHost(Object) 方法和 AddAssembly(Object) 方法所加入。

實作

屬性

範例

下列程式代碼範例示範 如何使用 GetEnumerator 方法。 這個範例是提供給 類別之較大範例的 Evidence 一部分。

int p = 0;
Console::WriteLine( "\nCurrent evidence = " );
if ( nullptr == myEvidence )
      return 0;

IEnumerator^ list = myEvidence->GetEnumerator();
IEnumerator^ myEnum1 = list;
while ( myEnum1->MoveNext() )
{
   Object^ obj = safe_cast<Object^>(myEnum1->Current);
   Console::WriteLine( obj );
   p++;
}
int p = 0;
Console.WriteLine("\nCurrent evidence = ");
if (null == myEvidence) return 0;
IEnumerator list = myEvidence.GetEnumerator();
while (list.MoveNext())
{
    Console.WriteLine(list.Current.ToString());
}
Dim p As Integer = 0
Console.WriteLine(ControlChars.Lf & "Current evidence = ")
If myEvidence Is Nothing Then
    Return 0
End If
Dim list As IEnumerator = myEvidence.GetEnumerator()
Dim obj As Object
While list.MoveNext()
    Console.WriteLine(list.Current.ToString())
    p = p + 1
End While

適用於