Evidence Konstruktor
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menginisialisasi instans baru kelas Evidence.
Overload
Evidence() |
Menginisialisasi instans Evidence kosong baru kelas. |
Evidence(Evidence) |
Menginisialisasi instans Evidence baru kelas dari salinan dangkal yang sudah ada. |
Evidence(Object[], Object[]) |
Kedaluwarsa.
Kedaluwarsa.
Kedaluwarsa.
Menginisialisasi instans Evidence baru kelas dari beberapa set bukti host dan assembly. |
Evidence(EvidenceBase[], EvidenceBase[]) |
Menginisialisasi instans Evidence baru kelas dari beberapa set bukti host dan assembly. |
Evidence()
Menginisialisasi instans Evidence kosong baru kelas.
public:
Evidence();
public Evidence ();
Public Sub New ()
Contoh
Contoh kode berikut menunjukkan penggunaan Evidence() konstruktor. Contoh ini adalah bagian dari contoh yang lebih besar yang disediakan untuk Evidence kelas .
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.")
Berlaku untuk
Evidence(Evidence)
Menginisialisasi instans Evidence baru kelas dari salinan dangkal yang sudah ada.
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)
Parameter
- evidence
- Evidence
Instans Evidence untuk membuat instans baru. Instans ini tidak disalin secara mendalam.
Pengecualian
Parameter evidence
bukan instans yang valid dari Evidence.
Contoh
Contoh kode berikut menunjukkan penggunaan Evidence(Evidence) konstruktor. Contoh ini adalah bagian dari contoh yang lebih besar yang disediakan untuk Evidence kelas .
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)))
Berlaku untuk
Evidence(Object[], Object[])
Perhatian
This constructor is obsolete. Use the constructor which accepts arrays of EvidenceBase instead.
Perhatian
This constructor is obsolete. Please use the constructor which takes arrays of EvidenceBase instead.
Perhatian
API ini sudah tidak digunakan lagi.
Menginisialisasi instans Evidence baru kelas dari beberapa set bukti host dan assembly.
public:
Evidence(cli::array <System::Object ^> ^ hostEvidence, cli::array <System::Object ^> ^ assemblyEvidence);
[System.Obsolete("This constructor is obsolete. Use the constructor which accepts arrays of EvidenceBase instead.")]
public Evidence (object[] hostEvidence, 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);
[System.Obsolete]
public Evidence (object[] hostEvidence, object[] assemblyEvidence);
[<System.Obsolete("This constructor is obsolete. Use the constructor which accepts arrays of EvidenceBase instead.")>]
new System.Security.Policy.Evidence : obj[] * obj[] -> System.Security.Policy.Evidence
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
[<System.Obsolete>]
new System.Security.Policy.Evidence : obj[] * obj[] -> System.Security.Policy.Evidence
Public Sub New (hostEvidence As Object(), assemblyEvidence As Object())
Parameter
- hostEvidence
- Object[]
Bukti host untuk membuat instans baru.
- assemblyEvidence
- Object[]
Bukti perakitan untuk membuat instans baru.
- Atribut
Contoh
Contoh kode berikut menunjukkan penggunaan Evidence(Object[], Object[]) konstruktor. Contoh ini adalah bagian dari contoh yang lebih besar yang disediakan untuk Evidence kelas .
array<Object^>^oa1 = {};
Site^ site = gcnew Site( "www.wideworldimporters.com" );
array<Object^>^oa2 = {url,site};
Evidence^ ev3a = gcnew Evidence( oa1,oa2 );
enum1 = ev3a->GetHostEnumerator();
IEnumerator^ enum2 = ev3a->GetAssemblyEnumerator();
enum2->MoveNext();
Object^ obj1 = enum2->Current;
enum2->MoveNext();
Console::WriteLine( "URL = {0} Site = {1}", obj1, enum2->Current );
Object [] oa1 = {};
Site site = new Site("www.wideworldimporters.com");
Object [] oa2 = { url, site };
Evidence ev3a = new Evidence(oa1, oa2);
enum1 = ev3a.GetHostEnumerator();
IEnumerator enum2 = ev3a.GetAssemblyEnumerator();
enum2.MoveNext();
Object obj1 = enum2.Current;
enum2.MoveNext();
Console.WriteLine("URL = " + obj1.ToString() + " Site = " + enum2.Current.ToString());
Dim oa1() As [Object]
Dim site As New Site("www.wideworldimporters.com")
Dim oa2 As [Object]() = {url, site}
Dim ev3a As New Evidence(oa1, oa2)
enum1 = ev3a.GetHostEnumerator()
Dim enum2 As IEnumerator = ev3a.GetAssemblyEnumerator()
enum2.MoveNext()
Dim obj1 As [Object] = enum2.Current
enum2.MoveNext()
Console.WriteLine(("URL = " & obj1.ToString() & " Site = " & enum2.Current.ToString()))
Berlaku untuk
Evidence(EvidenceBase[], EvidenceBase[])
Menginisialisasi instans Evidence baru kelas dari beberapa set bukti host dan assembly.
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())
Parameter
- hostEvidence
- EvidenceBase[]
Bukti host untuk membuat instans baru.
- assemblyEvidence
- EvidenceBase[]
Bukti perakitan untuk membuat instans baru.
Keterangan
Konstruktor ini membuat instans baru kelas dengan menggunakan objek bukti yang mewarisi dari EvidenceBase kelas .