WebPermission.Copy Método

Definición

Crea una copia de un objeto WebPermission.

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

Devoluciones

Una nueva instancia de la clase WebPermission con los mismos valores que la original.

Ejemplos

En el ejemplo siguiente se muestra cómo crear una segunda instancia de WebPermission mediante Copy. Esta segunda instancia es idéntica a la primera.

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

Comentarios

El IPermission devuelto por este método representa el mismo acceso a los recursos que el original WebPermission. Este método invalida Copy y se implementa para admitir la IPermission interfaz .

Se aplica a