I am using FluentScheduler
, and have a Registry class,
public class UnreadAlertRegistry : Registry
{
public UnreadAlertRegistry(int minute, string user, bool? type)
{
var alertAction = new Action(() =>
{
// show message box
}
Schedule(alertAction).ToRunEvery(minute).Minutes();
}
}
and in app, i Initialize it.
alert = new UnreadAlertRegistry(5, _dashboardUser, false);
TaskManager.Initialize(alert);
it is run every 5 minute.
I want to stop this. How do i stop this Scheduler?
I set a Name for schedule.
Schedule(alertAction).WithName("UnreadAlertRegistry").ToRunEvery(minute).Minutes();
and for stop it , use RemoveTask
TaskManager.RemoveTask("UnreadAlertRegistry");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With