WebPermission.Copy Méthode

Définition

Crée une copie de 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

Retours

IPermission

Nouvelle instance de la classe WebPermission ayant les mêmes valeurs que la classe d'origine.

Exemples

L’exemple suivant montre comment créer une deuxième instance d’utilisation WebPermission Copy. Cette deuxième instance est identique au premier.

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

Remarques

La IPermission méthode retournée représente le même accès aux ressources que l’original WebPermission. Cette méthode remplace Copy et est implémentée pour prendre en charge l’interface IPermission .

S’applique à