title: quartz.net - Can I not add a callback delegate method to JobExecutionContext?
body: <p><strong>BACKGROUND</strong> - I have a synchroisation function within my MainForm class.  It gets called manually when the user pushes the SYNC button.   I want to also call this synchroisation function when the scheduler triggers too, so effectively want SchedulerJob:IJob.Execute() method to be able to call it.  </p>
  
  <p><strong>QUESTION</strong> - How do I access the MainForm.Sychronization() method from within the SchedulerJob:IJob.Execute() method? </p>
  
  <p>I tried creating a delegate for this method in the MainForm class and getting it added via jobDetail.JobDataMap.   However when I try I'm not sure that JobDataMap has a method to pull out a Delegate type???</p>
  
  <pre><code>private void Schedule(MainForm.SyncDelegate _syncNow)
  {
      var jobDetail = new JobDetail("MainJob", null, typeof(SchedulerJob));
      jobDetail.JobDataMap["CallbackMethod"] = _syncNow;
  
      // Trigger Setup
      var trigger = new CronTrigger("MainTrigger");
      string expression = GetCronExpression();
      trigger.CronExpressionString = expression;
      trigger.StartTimeUtc = DateTime.Now.ToUniversalTime();
  
      // Schedule Job &amp; Trigger 
      _scheduler.ScheduleJob(jobDetail, trigger);
  }
  
  
  public class SchedulerJob : IJob
  {
      public SchedulerJob()
      {
      }
  
      public void Execute(JobExecutionContext context)
      {
          JobDataMap dataMap = context.JobDetail.JobDataMap;
          MainForm.SyncDelegate CallbackFunction = dataMap.getDelegate["CallbackMethod"];  
             **// THIS METHOD DOESN'T EXIST - getDelegate()**
          CallbackFunction();
  
      }
  }
  </code></pre>
  
  <hr/>
  
  <p>PS.bump - really stuck here - any help welcomed</p>
  
  <p>Another way to put forward my issue is:  If I want my Job to be able to call back to the Main UI periodically to update progress (e.g. which would be displayed in the progress bar of the MainForm), then how would I arrange to do this?   The .NET backgroundworker control
  has a way to do this, however how would I do this using Quartz.net? </p>