internal static bool HasPermission(PrintingPermission permission) { try { permission.Demand(); return true; } catch (SecurityException) { return false; } }