void s_JobEvent(JobEventArgs e)
        {
            //If you throw an exception here, you will kill the asp.net worker process and it will have to restart. Don't.
            try {
                if (HttpContext.Current == null) return; //When using async mode, there is no session, no request, nothing. You can send e-mails and hit the database using web.config settings.

                Response.Write("\n\n" + e.ToString());
                //This is normally where you would e-mail the user about the result of the job. Job stats and individual item results are available in the args.
            } catch (Exception ex) {
                //Log the exception somehow, but don't throw another exception.
            }
        }
Esempio n. 2
0
        private void JobFailed(BatchResizeSettings s, Exception ex)
        {
            JobEventArgs args = new JobEventArgs(s.jobId, new JobResult(results, false, ex, GetJobStats()));

            s.FireJobEvent(args);
        }
Esempio n. 3
0
        private void JobCompleted(BatchResizeSettings s)
        {
            JobEventArgs args = new JobEventArgs(s.jobId, new JobResult(results, true, null, GetJobStats()));

            s.FireJobEvent(args);
        }
Esempio n. 4
0
 private void JobFailed(BatchResizeSettings s,Exception ex)
 {
     JobEventArgs args = new JobEventArgs(s.jobId, new JobResult(results,false, ex, GetJobStats()));
     s.FireJobEvent(args);
 }
Esempio n. 5
0
 private void JobCompleted(BatchResizeSettings s)
 {
     JobEventArgs args = new JobEventArgs(s.jobId, new JobResult(results, true,null, GetJobStats()));
     s.FireJobEvent(args);
 }
Esempio n. 6
0
 protected internal void FireJobEvent(JobEventArgs e)
 {
     if (JobEvent != null) JobEvent(e);
 }
 void s_JobEvent(JobEventArgs e)
 {
     if (RunWorkerCompletedEvent != null)
         RunWorkerCompletedEvent(this, new RunWorkerCompletedEventArgs(e.Result, null, false));
 }