Evidence::Merge Method (Evidence^)
Merges the specified evidence set into the current evidence set.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- evidence
-
Type:
System.Security.Policy::Evidence^
The evidence set to be merged into the current evidence set.
| Exception | Condition |
|---|---|
| ArgumentException | The evidence parameter is not a valid instance of Evidence. |
| SecurityException | Locked is true, the code that calls this method does not have SecurityPermissionFlag::ControlEvidence, and the evidence parameter has a host list that is not empty. |
Each evidence object in the specified evidence set is added to the assembly and host sets of the current evidence set, according to the sets from which it came.
Note |
|---|
This method does not perform a check to prevent adding duplicate types of evidence. Many assembly and host evidence objects can exist at the same time. |
The following code example shows the use of the Merge method. This example is part of a larger example provided for the Evidence class.
Console::WriteLine( "\nMerge new evidence with the current evidence." ); array<Object^>^oa1 = {}; Site^ site = gcnew Site( "www.wideworldimporters.com" ); array<Object^>^oa2 = {url,site}; Evidence^ newEvidence = gcnew Evidence( oa1,oa2 ); myEvidence->Merge( newEvidence ); Console::WriteLine( "Evidence count = {0}", PrintEvidence( myEvidence ) );
for the ability to manipulate evidence when Locked is true and the evidence parameter has a host list that is not empty. Associated enumeration: SecurityPermissionFlag::ControlEvidence
Available since 1.1
