本文整理汇总了C#中IScheduler.AddGlobalTriggerListener方法的典型用法代码示例。如果您正苦于以下问题:C# IScheduler.AddGlobalTriggerListener方法的具体用法?C# IScheduler.AddGlobalTriggerListener怎么用?C# IScheduler.AddGlobalTriggerListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScheduler
的用法示例。
在下文中一共展示了IScheduler.AddGlobalTriggerListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Scheduler
public Scheduler()
{
var applicationSettings = SettingProvider.LoadApplicationSettings();
if (applicationSettings == null)
{
SettingProvider.Save(new ApplicationSettings
{
Accounts = new List<Account> { new Account() },
Services = new List<ReminderService> { new ReminderService() }
});
Environment.Exit(1);
}
scheduler = new StdSchedulerFactory().GetScheduler();
scheduler.AddGlobalTriggerListener(new ShabbosTriggerListener());
foreach (var service in applicationSettings.Services)
{
SchedulerHelper.ScheduleZmanJob(scheduler, service,
applicationSettings.Accounts.Where(a => a.Id == service.AccountId).First()
);
}
}
示例2: Initialize
/// <summary>
/// Called during creation of the <see cref="IScheduler" /> in order to give
/// the <see cref="ISchedulerPlugin" /> a chance to Initialize.
/// </summary>
public virtual void Initialize(String pluginName, IScheduler sched)
{
name = pluginName;
sched.AddGlobalTriggerListener(this);
}