4
我使用FluentScheduler
,并有登记类,如何停止FluentScheduler的任务?
public class UnreadAlertRegistry : Registry
{
public UnreadAlertRegistry(int minute, string user, bool? type)
{
var alertAction = new Action(() =>
{
// show message box
}
Schedule(alertAction).ToRunEvery(minute).Minutes();
}
}
和应用程序,我将其初始化。
alert = new UnreadAlertRegistry(5, _dashboardUser, false);
TaskManager.Initialize(alert);
它运行每5分。
我想停止这个。我该如何阻止此调度程序?