Evidence.CopyTo(Array, Int32) Method

Definition

Caution

Evidence should not be treated as an ICollection. Use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.

Caution

Evidence should not be treated as an ICollection. Please use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.

Caution

This API is now deprecated.

Copies evidence objects to an Array.

C#
[System.Obsolete("Evidence should not be treated as an ICollection. Use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.")]
public void CopyTo(Array array, int index);
C#
[System.Obsolete("Evidence should not be treated as an ICollection. Please use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.")]
public void CopyTo(Array array, int index);
C#
public void CopyTo(Array array, int index);
C#
[System.Obsolete]
public void CopyTo(Array array, int index);

Parameters

array
Array

The target array to which to copy evidence objects.

index
Int32

The zero-based position in the array to which to begin copying evidence objects.

Implements

Attributes

Exceptions

array is null.

index is outside the range of the target array.

Examples

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

C#
Console.WriteLine("\nCopy the evidence to an array using CopyTo, then display the array.");
object[] evidenceArray = new object[myEvidence.Count];
myEvidence.CopyTo(evidenceArray, 0);
foreach (object obj in evidenceArray)
{
    Console.WriteLine(obj.ToString());
}

Applies to

Product Versions (Obsolete)
.NET (6 (package-provided), 6, 7 (package-provided), 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10)
.NET Framework 1.1, 2.0, 3.0, 3.5 (4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1)
.NET Standard (2.0 (package-provided))
Windows Desktop (3.0, 3.1, 5, 6, 7, 8, 9, 10)