本文整理汇总了C#中IScheduler.AddTriggerListener方法的典型用法代码示例。如果您正苦于以下问题:C# IScheduler.AddTriggerListener方法的具体用法?C# IScheduler.AddTriggerListener怎么用?C# IScheduler.AddTriggerListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScheduler
的用法示例。
在下文中一共展示了IScheduler.AddTriggerListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScheduleJobs
/// <summary>
/// Add the Jobs and Triggers defined in the given map of <see cref="JobSchedulingBundle" />
/// s to the given scheduler.
/// </summary>
/// <param name="jobBundles">The job bundles.</param>
/// <param name="sched">The sched.</param>
/// <param name="overwriteExistingJobs">if set to <c>true</c> [over write existing jobs].</param>
public virtual void ScheduleJobs(IDictionary jobBundles, IScheduler sched, bool overwriteExistingJobs)
{
Log.Info(string.Format(CultureInfo.InvariantCulture, "Scheduling {0} parsed jobs.", jobsToSchedule.Count));
foreach (CalendarBundle bndle in calsToSchedule)
{
AddCalendar(sched, bndle);
}
foreach (JobSchedulingBundle bndle in jobsToSchedule)
{
ScheduleJob(bndle, sched, overwriteExistingJobs);
}
foreach (IJobListener listener in listenersToSchedule)
{
Log.Info(string.Format(CultureInfo.InvariantCulture, "adding listener {0} of type {1}", listener.Name, listener.GetType().FullName));
sched.AddJobListener(listener);
}
foreach (ITriggerListener listener in triggerListenersToSchedule)
{
Log.Info(string.Format(CultureInfo.InvariantCulture, "adding listener {0} of type {1}", listener.Name, listener.GetType().FullName));
sched.AddTriggerListener(listener);
}
Log.Info(string.Format(CultureInfo.InvariantCulture, "{0} scheduled jobs.", jobBundles.Count));
}
示例2: Initialize
public void Initialize(string pluginName, IScheduler sched)
{
sched.AddTriggerListener(_triggerListener);
sched.AddJobListener(_jobListener);
}