Пример #1
0
 protected void InvokeReportProgress(string message)
 {
     EventHandler<IUICommandReportProgressEventArgs> reportProgressHandler = ReportProgress;
     if (reportProgressHandler != null)
     {
         IUICommandReportProgressEventArgs eventArgs = new IUICommandReportProgressEventArgs(message);
         reportProgressHandler(this, eventArgs);
     }
 }
Пример #2
0
 private void OnBackgroundWorkerUICommandDoWork(object sender, DoWorkEventArgs e)
 {
     IUICommand command = (IUICommand)e.Argument;
     IUICommandReportProgressEventArgs initReportProgress = new IUICommandReportProgressEventArgs(string.Format(Resources.InitUICommand, command.CommandName));
     backgroundWorkerUICommand.ReportProgress(0, initReportProgress);
     command.ReportProgress += delegate(object reportProgresssender, IUICommandReportProgressEventArgs eventArgs)
                                   {
                                       backgroundWorkerUICommand.ReportProgress(0, eventArgs);
                                   };
     e.Result = command.Execute();
 }