2013-06-21 55 views

回答

1

你可以試試:

Quartz.Collection.ISet<JobKey> jobKeys = scheduler.GetJobKeys(GroupMatcher<JobKey>.GroupEquals(SchedulerConstants.DefaultGroup)); 
jobKeys.Where(key => key.Name == "Your job name") 
+0

添加以下組件來得到這個工作: 使用Quartz.Impl.Matchers;使用Quartz.Collection的 ; 但ISet不包含'Where'的定義嗎?需要添加什麼組件才能爲ISet啓用此擴展? –

+0

只適用於來自System.Collections.Generic的ISet,而不適用於Quartz.Collection。 –

+0

System.Linq我猜 – ryudice

0

彙總,以下工作:

using Quartz; 
using Quartz.Impl.Matchers; 
using Quartz.Collection; 
using System.Linq; 


ISet<JobKey> jobKeys = _scheduler.GetJobKeys(GroupMatcher<JobKey>.GroupEquals(SchedulerConstants.DefaultGroup)); 
JobKey key = jobKeys.Where(x => x.Name == jobName).First(); 
IJobDetail jobData = _scheduler.GetJobDetail(key);