Demand() публичный Метод

public Demand ( ) : void
Результат void
Пример #1
0
 internal static bool IsPermissionGranted(CodeAccessPermission requestedPermission)
 {
     try
     {
         // Try and get this permission
         requestedPermission.Demand();
         return true;
     }
     catch
     {
         return false;
     }
 }
Пример #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();
 }