public override void OnReport(CorutineReport report)
 {
     if(report is CorutineReportText)
     {
         CorutineReportText repotext = report as CorutineReportText;
         //Label label = control as Label;
         control.Invoke((MethodInvoker)delegate()
         {
             control.Text = string.Format(pattern, repotext.message);
         });
     }
 }
 public override void OnReport(CorutineReport report)
 {
     if(report is CorutineReportPercentage)
     {
         //only for percentage report is capturesd
         CorutineReportPercentage percRepo = report as CorutineReportPercentage;
         ProgressBar bar = control as ProgressBar;
         bar.Invoke((MethodInvoker)delegate()
         {
             bar.Value = percRepo.percentage;
         });
     }
 }
 public override void OnReport(CorutineReport report)
 {
     //base.OnReport(report);
     if (report is CorutineReportPercentage)
     {
         CorutineReportPercentage repoperc = report as CorutineReportPercentage;
         //Label label = control as Label;
         control.Invoke((MethodInvoker)delegate()
         {
             control.Text = string.Format(pattern, repoperc.percentage);
         });
     }
 }
 public override void OnReport(CorutineReport report)
 {
     //throw new NotImplementedException();
     if(report is CorutineReportCancelled)
     {
         if (handler != null)
         {
             //handle result in gui thread
             control.Invoke((MethodInvoker)delegate
             {
                 handler();
             });
         }
     }
 }
 /// <summary>
 /// Called when report from corutine got
 /// </summary>
 /// <param name="report"></param>
 public abstract void OnReport(CorutineReport report);
 /// <summary>
 /// Process report from slave thread
 /// </summary>
 /// <param name="rep">Report</param>
 private void ProcessReportSlave(CorutineReport rep)
 {
     reportQueue.Enqueue(rep);
 }