我打算在Quartz.net上使用RAMJobStore。从我的阅读中,我们可以在Xml中配置作业并让Xml插件在运行时读取作业并触发它们
但是有一个API可以编写新作业或以编程方式更新现有的Xml
答案 0 :(得分:1)
我认为你不能找到类似的东西,但你可以写自己的。 这是一个愚蠢的样本 看看它。它可能有所帮助:
jobschedulingdataSchedule[] jbSchedule = { new jobschedulingdataSchedule() };
jobdetailType[] jobs = {new jobdetailType() { description = "Blah" } };
triggerType[] triggers = {new triggerType() { Item = new simpleTriggerType() { description = "Blah" } } };
jbSchedule[0].job = jobs;
jbSchedule[0].trigger = triggers;
var quartzConfig = new QuartzXmlConfiguration20();
quartzConfig.version = "2.0";
quartzConfig.schedule = jbSchedule;
var quartzJobsXml = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "quartz_jobs.xml");
using (TextWriter textWriter = new StreamWriter(quartzJobsXml))
{
XmlSerializer serializer = new XmlSerializer(typeof(Quartz.Xml.JobSchedulingData20.QuartzXmlConfiguration20));
serializer.Serialize(textWriter, quartzConfig);
}