c# - How to stop a task of FluentScheduler? -
i using fluentscheduler
, , have 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, initialize it.
alert = new unreadalertregistry(5, _dashboarduser, false); taskmanager.initialize(alert);
it run every 5 minute.
i want stop this. how stop scheduler?
i set name schedule.
schedule(alertaction).withname("unreadalertregistry").torunevery(minute).minutes();
and stop , use removetask
taskmanager.removetask("unreadalertregistry");
Comments
Post a Comment