我正在使用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分钟运行一次。
我想阻止这一切。我该怎么阻止这个计划呢?
发布于 2016-02-28 05:34:43
我为时间表定了个名字。
Schedule(alertAction).WithName("UnreadAlertRegistry").ToRunEvery(minute).Minutes();为了阻止它,请使用RemoveTask
TaskManager.RemoveTask("UnreadAlertRegistry");https://stackoverflow.com/questions/35668592
复制相似问题