Used by Quartz.NET. There is a class
class SampleJob : IJob { public delegate void SampleNotification(string message); public event SampleNotification OnEvent; public void Execute(IJobExecutionContext context) { OnEvent(messageString); } } I create the scheduler:
var job = JobBuilder.Create<SampleJob>().WithIdentity(jobName, groupName).Build(); var trigger = (ICronTrigger) TriggerBuilder.Create() .WithIdentity(triggerName, groupName) .WithCronSchedule(cronLine) .Build(); //добавляю job и trigger в Scheduler Is it possible to subscribe to the event inside Execute SampleJob from the place where it is added to the scheduler?