コード例 #1
0
        private void UpdateProgress(object sender, ProgressUpdateEventArgs e)
        {
            // Unblock the waiting thread, if there was a cancel or error
            lock (CHANGE_EVENT_LOCK)
            {
                // Keep track of last progress, but do not overwrite an error
                if (LastProgress == null || !LastProgress.IsError)
                    LastProgress = (!e.Progress.IsComplete ? e.Progress : null);
                if (e.Progress.IsCanceled || e.Progress.IsError)
                    Monitor.Pulse(CHANGE_EVENT_LOCK);
            }

            if (ProgressMonitor != null)
                ProgressMonitor.UpdateProgress(e.Progress);
        }
コード例 #2
0
 protected UpdateProgressResponse UpdateProgress(ProgressStatus status)
 {
     if (ProgressUpdateEvent != null)
     {
         var args = new ProgressUpdateEventArgs(status);
         ProgressUpdateEvent(this, args);
         return args.Response;
     }
     return UpdateProgressResponse.normal;
 }