Demand() public method

public Demand ( ) : void
return void
Ejemplo n.º 1
0
 internal static bool IsPermissionGranted(CodeAccessPermission requestedPermission)
 {
     try
     {
         // Try and get this permission
         requestedPermission.Demand();
         return true;
     }
     catch
     {
         return false;
     }
 }
Ejemplo n.º 2
0
 // A better implementation would cache this information over the lifetime of the application,
 // so the permission only needs to be evaluated once.
 private bool CheckPermission(CodeAccessPermission requestedPermission)
 {
     try
     {
         // Try to get this permission.
         requestedPermission.Demand();
         return true;
     }
     catch
     {
         return false;
     }
 }
 private static void Demand(CodeAccessPermission permission)
 {
     permission.Demand();
 }