Редагувати

Поділитися через


Evidence.GetEnumerator Method

Definition

Caution

GetEnumerator is obsolete. Please use GetAssemblyEnumerator and GetHostEnumerator instead.

Caution

GetEnumerator is obsolete. Use GetAssemblyEnumerator and GetHostEnumerator instead.

Caution

This API is now deprecated.

Enumerates all evidence in the set, both that provided by the host and that provided by the assembly.

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

Returns

An enumerator for evidence added by both the AddHost(Object) method and the AddAssembly(Object) method.

Implements

Attributes

Examples

The following code example shows the use of the GetEnumerator method. This example is part of a larger example provided for the Evidence class.

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

Applies to