DataProtectionPermission.Union(IPermission) 메서드

정의

현재 사용 권한 및 지정한 사용 권한을 합한 사용 권한을 만듭니다.

public:
 override System::Security::IPermission ^ Union(System::Security::IPermission ^ target);
public override System.Security.IPermission Union (System.Security.IPermission target);
override this.Union : System.Security.IPermission -> System.Security.IPermission
Public Overrides Function Union (target As IPermission) As IPermission

매개 변수

target
IPermission

현재 사용 권한과 결합할 사용 권한입니다. 현재 사용 권한과 동일한 형식이어야 합니다.

반환

IPermission

현재 사용 권한 및 지정한 사용 권한의 합을 나타내는 새 사용 권한입니다.

예외

targetnull 가 아니며 현재 사용 권한과 동일한 유형의 사용 권한을 지정하지 않습니다.

예제

다음 코드 예제에서는 메서드의 사용을 보여 있습니다 Union . 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DataProtectionPermission 클래스입니다.

참고

코드 예제는 메서드의 사용을 보여 주는 것이 아니라 메서드의 동작을 표시하기 위한 것입니다. 으로 보안 인프라를 권한 클래스의 메서드를 사용 하는 일반적으로 애플리케이션에서 사용 되지 됩니다.

Console::WriteLine( "Creating the union of the second and first "
"permissions." );
sp4 = dynamic_cast<DataProtectionPermission^>(sp2->Union( sp1 ));
Console::WriteLine( "Result of the union of the second permission "
"with the first: {0}", sp4->Flags );
Console.WriteLine("Creating the union of the second and first " +
    "permissions.");
sp4 = (DataProtectionPermission)sp2.Union(sp1);
Console.WriteLine("Result of the union of the second permission " +
    "with the first: " + sp4.Flags);
Console.WriteLine("Creating the union of the second and first " + "permissions.")
sp4 = CType(sp2.Union(sp1), DataProtectionPermission)
Console.WriteLine("Result of the union of the second permission with the first: " + sp4.Flags.ToString())

설명

호출 Union 의 결과는 현재 사용 권한과 지정된 사용 권한 모두에 의해 표시되는 모든 작업을 나타내는 권한입니다. 사용 권한을 통과하는 모든 요구는 해당 공용 구조체를 통과합니다.

적용 대상