Evidence.Count Property

Note: This API is now obsolete.

Gets the number of evidence objects in the evidence set.

Namespace:   System.Security.Policy
Assembly:  mscorlib (in mscorlib.dll)

[ObsoleteAttribute("Evidence should not be treated as an ICollection. Please use GetHostEnumerator and GetAssemblyEnumerator to iterate over the evidence to collect a count.")]
public int Count { get; }

Property Value

Type: System.Int32

The number of evidence objects in the evidence set.

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

Console.WriteLine("\nMake a copy of the current evidence.");
Evidence evidenceCopy = new Evidence(myEvidence);
Console.WriteLine("Count of new evidence items = " + evidenceCopy.Count);
Console.WriteLine("Does the copy equal the current evidence? " + myEvidence.Equals(evidenceCopy));

.NET Framework
Available since 1.1
Return to top