System.Security.CodeAccessPermission.Demand C# (CSharp) Method

Demand() public method

public Demand ( ) : void
return void
        public void Demand() { }
        [Obsolete("Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]

Usage Example

 internal static bool IsPermissionGranted(CodeAccessPermission requestedPermission)
 {
     try
     {
         // Try and get this permission
         requestedPermission.Demand();
         return true;
     }
     catch
     {
         return false;
     }
 }
All Usage Examples Of System.Security.CodeAccessPermission::Demand