WebPermission.Copy Metoda

Definice

Vytvoří kopii WebPermissionsouboru .

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

Návraty

IPermission

Nová instance WebPermission třídy, která má stejné hodnoty jako původní.

Příklady

Následující příklad ukazuje, jak vytvořit druhou instanci WebPermission using Copy. Tato druhá instance je stejná jako první.

// Create another WebPermission instance that is the copy of the above WebPermission instance.
WebPermission^ myWebPermission2 = (WebPermission^)(myWebPermission1->Copy());

// Check whether all callers higher in the call stack have been granted the permissionor not.
myWebPermission2->Demand();
 // Create another WebPermission instance that is the copy of the above WebPermission instance.
  WebPermission myWebPermission2 = (WebPermission) myWebPermission1.Copy();

 // Check whether all callers higher in the call stack have been granted the permissionor not.
 myWebPermission2.Demand();
' Create another WebPermission instance that is the copy of the above WebPermission instance.
Dim myWebPermission2 As WebPermission = CType(myWebPermission1.Copy(), WebPermission)

' Check whether all callers higher in the call stack have been granted the permissionor not.
myWebPermission2.Demand()

Poznámky

Vrácená IPermission touto metodou představuje stejný přístup k prostředkům jako původní WebPermission. Tato metoda přepíše a implementuje Copy se pro podporu IPermission rozhraní.

Platí pro