Evidence Constructors

Definition

Initializes a new instance of the Evidence class.

Overloads

Name Description
Evidence()

Initializes a new empty instance of the Evidence class.

Evidence(Evidence)

Initializes a new instance of the Evidence class from a shallow copy of an existing one.

Evidence(Object[], Object[])
Obsolete.

Initializes a new instance of the Evidence class from multiple sets of host and assembly evidence.

Evidence(EvidenceBase[], EvidenceBase[])

Initializes a new instance of the Evidence class from multiple sets of host and assembly evidence.

Evidence()

Initializes a new empty instance of the Evidence class.

public:
 Evidence();
public Evidence();
Public Sub New ()

Examples

The following code example shows the use of the Evidence() constructor. This example is part of a larger example provided for the Evidence class.

Evidence^ ev1 = gcnew Evidence;
Console::WriteLine( "Created empty evidence with the default constructor." );
Evidence ev1 = new Evidence();
Console.WriteLine("Created empty evidence with the default constructor.");
Dim ev1 As New Evidence
Console.WriteLine("Created empty evidence with the default constructor.")

Applies to

Evidence(Evidence)

Initializes a new instance of the Evidence class from a shallow copy of an existing one.

public:
 Evidence(System::Security::Policy::Evidence ^ evidence);
public Evidence(System.Security.Policy.Evidence evidence);
new System.Security.Policy.Evidence : System.Security.Policy.Evidence -> System.Security.Policy.Evidence
Public Sub New (evidence As Evidence)

Parameters

evidence
Evidence

The Evidence instance from which to create the new instance. This instance is not deep-copied.

Exceptions

The evidence parameter is not a valid instance of Evidence.

Examples

The following code example shows the use of the Evidence(Evidence) constructor. This example is part of a larger example provided for the Evidence class.

Console::WriteLine( "\nMake a copy of the current evidence." );
Evidence^ evidenceCopy = gcnew Evidence( myEvidence );
Console::WriteLine( "Count of new evidence items = {0}", evidenceCopy->Count );
Console::WriteLine( "Does the copy equal the current evidence? {0}", myEvidence->Equals( evidenceCopy ) );
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));
Console.WriteLine(ControlChars.Lf & "Make a copy of the current evidence.")
Dim evidenceCopy As New Evidence(myEvidence)
Console.WriteLine(("Count of new evidence items = " & evidenceCopy.Count.ToString()))
Console.WriteLine(("Does the copy equal the current evidence? " & myEvidence.Equals(evidenceCopy)))

Applies to

Evidence(Object[], Object[])

Caution

This constructor is obsolete. Please use the constructor which takes arrays of EvidenceBase instead.

Initializes a new instance of the Evidence class from multiple sets of host and assembly evidence.

public:
 Evidence(cli::array <System::Object ^> ^ hostEvidence, cli::array <System::Object ^> ^ assemblyEvidence);
public Evidence(object[] hostEvidence, object[] assemblyEvidence);
[System.Obsolete("This constructor is obsolete. Please use the constructor which takes arrays of EvidenceBase instead.")]
public Evidence(object[] hostEvidence, object[] assemblyEvidence);
new System.Security.Policy.Evidence : obj[] * obj[] -> System.Security.Policy.Evidence
[<System.Obsolete("This constructor is obsolete. Please use the constructor which takes arrays of EvidenceBase instead.")>]
new System.Security.Policy.Evidence : obj[] * obj[] -> System.Security.Policy.Evidence
Public Sub New (hostEvidence As Object(), assemblyEvidence As Object())

Parameters

hostEvidence
Object[]

The host evidence from which to create the new instance.

assemblyEvidence
Object[]

The assembly evidence from which to create the new instance.

Attributes

Applies to

Evidence(EvidenceBase[], EvidenceBase[])

Initializes a new instance of the Evidence class from multiple sets of host and assembly evidence.

public:
 Evidence(cli::array <System::Security::Policy::EvidenceBase ^> ^ hostEvidence, cli::array <System::Security::Policy::EvidenceBase ^> ^ assemblyEvidence);
public Evidence(System.Security.Policy.EvidenceBase[] hostEvidence, System.Security.Policy.EvidenceBase[] assemblyEvidence);
new System.Security.Policy.Evidence : System.Security.Policy.EvidenceBase[] * System.Security.Policy.EvidenceBase[] -> System.Security.Policy.Evidence
Public Sub New (hostEvidence As EvidenceBase(), assemblyEvidence As EvidenceBase())

Parameters

hostEvidence
EvidenceBase[]

The host evidence from which to create the new instance.

assemblyEvidence
EvidenceBase[]

The assembly evidence from which to create the new instance.

Remarks

This constructor creates a new instance of the class by using evidence objects that inherit from the EvidenceBase class.

Applies to