次の方法で共有


Evidence コンストラクタ (Evidence)

既存のインスタンスの簡易コピーから Evidence クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Policy
アセンブリ: mscorlib (mscorlib.dll 内)

構文

'宣言
Public Sub New ( _
    evidence As Evidence _
)
'使用
Dim evidence As Evidence

Dim instance As New Evidence(evidence)
public Evidence (
    Evidence evidence
)
public:
Evidence (
    Evidence^ evidence
)
public Evidence (
    Evidence evidence
)
public function Evidence (
    evidence : Evidence
)
適用できません。

パラメータ

  • evidence
    新しいインスタンスの作成元の Evidence インスタンス。このインスタンスは、詳細コピーされていません。

例外

例外の種類 条件

ArgumentException

evidence パラメータが、Evidence の有効なインスタンスではありません。

使用例

Evidence(Evidence) コンストラクタを使用する方法を次のコード例に示します。このコード例は、Evidence クラスのトピックで取り上げているコード例の一部分です。

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)))
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( "\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.get_Count()));
Console.WriteLine(("Does the copy equal the current evidence? " 
    + System.Convert.ToString(myEvidence.Equals(evidenceCopy))));

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

Evidence クラス
Evidence メンバ
System.Security.Policy 名前空間