GacMembershipCondition.Copy Metode
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.
Membuat salinan yang setara dari kondisi keanggotaan.
public:
virtual System::Security::Policy::IMembershipCondition ^ Copy();
public System.Security.Policy.IMembershipCondition Copy ();
abstract member Copy : unit -> System.Security.Policy.IMembershipCondition
override this.Copy : unit -> System.Security.Policy.IMembershipCondition
Public Function Copy () As IMembershipCondition
Mengembalikan
Objek baru GacMembershipCondition .
Penerapan
Contoh
Contoh kode berikut menunjukkan penggunaan Copy metode . Contoh ini adalah bagian dari contoh yang lebih besar yang disediakan untuk GacMembershipCondition kelas .
GacMembershipCondition ^ Gac1 = gcnew GacMembershipCondition;
Console::WriteLine("Original membership condition = ");
Console::WriteLine(Gac1->ToXml());
try
{
IMembershipCondition^ membershipCondition = Gac1->Copy();
Console::WriteLine("Result of Copy = ");
Console::WriteLine(
(dynamic_cast<GacMembershipCondition^>(membershipCondition))
->ToXml());
}
catch (Exception^ e)
{
Console::WriteLine("Copy failed : {0}{1}", Gac1, e);
return false;
}
GacMembershipCondition Gac1 = new GacMembershipCondition();
Console.WriteLine("Original membership condition = ");
Console.WriteLine(Gac1.ToXml().ToString());
try
{
IMembershipCondition membershipCondition = Gac1.Copy();
Console.WriteLine("Result of Copy = ");
Console.WriteLine(
((GacMembershipCondition)membershipCondition).ToXml().ToString()
);
}
catch (Exception e)
{
Console.WriteLine("Copy failed : " + Gac1.ToString() + e);
return false;
}
Dim Gac1 As New GacMembershipCondition
Console.WriteLine("Original membership condition = ")
Console.WriteLine(Gac1.ToXml().ToString())
Try
Dim membershipCondition As IMembershipCondition = Gac1.Copy()
Console.WriteLine("Result of Copy = ")
Console.WriteLine(CType(membershipCondition, _
GacMembershipCondition).ToXml().ToString())
Catch e As Exception
Console.WriteLine(("Copy failed : " & Gac1.ToString() & _
e.ToString()))
Return False
End Try
Keterangan
Salinan kondisi keanggotaan identik dengan kondisi keanggotaan asli.
Berlaku untuk
Berkolaborasi dengan kami di GitHub
Sumber untuk konten ini dapat ditemukan di GitHub, yang juga dapat Anda gunakan untuk membuat dan meninjau masalah dan menarik permintaan. Untuk informasi selengkapnya, lihat panduan kontributor kami.