Aracılığıyla paylaş


DataProtectionPermission.Union(IPermission) Yöntem

Tanım

Geçerli iznin ve belirtilen iznin birleşimi olan bir izin oluşturur.

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

Parametreler

target
IPermission

Geçerli izinle birleştirme izni. Geçerli izinle aynı türde olmalıdır.

Döndürülenler

Geçerli iznin ve belirtilen iznin birleşimini temsil eden yeni bir izin.

Özel durumlar

targetnull değil ve geçerli izinle aynı türde bir izin belirtmez.

Örnekler

Aşağıdaki kod örneği yönteminin Union kullanımını gösterir. Bu kod örneği, sınıfı için DataProtectionPermission sağlanan daha büyük bir örneğin parçasıdır.

Not

Kod örneği, kullanımını göstermek için değil yönteminin davranışını göstermek için tasarlanmıştır. Genel olarak, izin sınıflarının yöntemleri güvenlik altyapısı tarafından kullanılır; bunlar genellikle uygulamalarda kullanılmaz.

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())

Açıklamalar

çağrısının Union sonucu, hem geçerli izin hem de belirtilen izinle temsil edilen tüm işlemleri temsil eden bir izindir. her iki izni de geçen tüm talepler birleşimlerini geçirir.

Şunlara uygulanır