/// <summary>
 /// Raises the proxy's RetryEnqueued event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void ProxyRetryEnqueued(object sender, JobRecordEventArgs e)
 {
     this.RaiseEvent(this.RetryEnqueued, e);
 }
 /// <summary>
 /// Raises the proxy's TimeoutJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void ProxyTimeoutJob(object sender, JobRecordEventArgs e)
 {
     this.RaiseEvent(this.TimeoutJob, e);
 }
 /// <summary>
 /// Raises the proxy's ExecuteScheduledJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void ProxyExecuteScheduledJob(object sender, JobRecordEventArgs e)
 {
     this.RaiseEvent(this.ExecuteScheduledJob, e);
 }
 /// <summary>
 /// Raises the proxy's FinishJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void ProxyFinishJob(object sender, JobRecordEventArgs e)
 {
     this.RaiseEvent(this.FinishJob, e);
 }
 /// <summary>
 /// Raises the proxy's CancelJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void ProxyCancelJob(object sender, JobRecordEventArgs e)
 {
     this.RaiseEvent(this.CancelJob, e);
 }
 /// <summary>
 /// Raises the proxy's DequeueJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void ProxyDequeueJob(object sender, JobRecordEventArgs e)
 {
     this.RaiseEvent(this.DequeueJob, e);
 }
 /// <summary>
 /// Raises the boostraper's TimeoutJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private static void BootstrapsTimeoutJob(object sender, JobRecordEventArgs e)
 {
     logger.Error(CultureInfo.InvariantCulture, "Timed out '{0}' ({1}) because it was taking too long to finish.", e.Record.Name, e.Record.Id);
 }
 /// <summary>
 /// Raises the boostraper's RetryEnqueued event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private static void BootstrapsRetryEnqueued(object sender, JobRecordEventArgs e)
 {
     logger.Info(CultureInfo.InvariantCulture, "Enqueued retry number {1} of job '{0}' ({2}). The retry is queued to execute in {3:N2} seconds.", e.Record.TryNumber, e.Record.Name, e.Record.Id, DateTime.UtcNow.Subtract(e.Record.QueueDate).TotalSeconds);
 }
 /// <summary>
 /// Raises the boostraper's FinishJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private static void BootstrapsFinishJob(object sender, JobRecordEventArgs e)
 {
     if (e.Record.Status == JobStatus.Succeeded)
     {
         logger.Info(CultureInfo.InvariantCulture, "'{0}' ({1}) completed successfully.", e.Record.Name, e.Record.Id);
     }
     else
     {
         string message = ExceptionXElement.Parse(e.Record.Exception).Descendants("Message").First().Value;
         logger.Error(CultureInfo.InvariantCulture, "'{0}' ({1}) failed with the message: {2}.", e.Record.Name, e.Record.Id, message);
     }
 }
 /// <summary>
 /// Raises the bootstrapper's ExecuteScheduledJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private static void BootstrapsExecuteScheduledJob(object sender, JobRecordEventArgs e)
 {
     logger.Info(CultureInfo.InvariantCulture, "Started execution of '{0}' ({1}) for schedule '{2}'.", e.Record.Name, e.Record.Id, e.Record.ScheduleName);
 }
 /// <summary>
 /// Raises the boostraper's DequeueJob event.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private static void BootstrapsDequeueJob(object sender, JobRecordEventArgs e)
 {
     logger.Info(CultureInfo.InvariantCulture, "Dequeued '{0}' ({1}).", e.Record.Name, e.Record.Id);
 }