Share via


GacMembershipCondition.Copy 메서드

정의

멤버 자격 조건의 동일한 복사본을 만듭니다.

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

반환

GacMembershipCondition 개체입니다.

구현

예제

다음 코드 예제에서는 사용 된 메서드입니다 Copy . 이 예제는에 대해 제공 된 큰 예제의 일부는 GacMembershipCondition 클래스입니다.

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

설명

멤버 자격 조건의 복사본은 원래 멤버 자격 조건과 동일합니다.

적용 대상