我正在使用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 分钟运行一次。
我想阻止这一切。我如何停止这个调度程序?