Compartilhar via


Evidence.GetEnumerator Método

Definição

Cuidado

GetEnumerator is obsolete. Use GetAssemblyEnumerator and GetHostEnumerator instead.

Cuidado

GetEnumerator is obsolete. Please use GetAssemblyEnumerator and GetHostEnumerator instead.

Cuidado

Essa API foi preterida.

Enumera todas as evidências no conjunto, tanto fornecidas pelo host quanto fornecidas pelo assembly.

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

Retornos

Um enumerador para evidência adicionado por ambos os métodos AddHost(Object) e AddAssembly(Object).

Implementações

Atributos

Exemplos

O exemplo de código a seguir mostra o uso do GetEnumerator método . Este exemplo faz parte de um exemplo maior fornecido para a Evidence classe .

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

Aplica-se a