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

适用于