Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/16/17 10:30:21 (7 years ago)
Author:
pfleck
Message:

#2845

  • Added an explicit method for StartMarquee.
  • Renamed Add/RemoveOperationProgress methods.
  • Moved progress helpers from MainForm into static Progress methods named Show and Hide.
Location:
branches/EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs

    r14185 r15477  
    8282      task.ItemTask.ComputeInParallel = content is Experiment || content is BatchRun;
    8383
    84       progress = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToContent(this.content, "Uploading to Hive...");
     84      progress = Progress.ShowMarquee(this.content, "Uploading to Hive...");
    8585      rJob.Progress = progress;
    8686      progress.ProgressStateChanged += progress_ProgressStateChanged;
     
    9191    private void progress_ProgressStateChanged(object sender, EventArgs e) {
    9292      if (progress.ProgressState != ProgressState.Started) {
    93         MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);
     93        Progress.Hide(content);
    9494        progress.ProgressStateChanged -= progress_ProgressStateChanged;
    9595      }
     
    9797
    9898    private void HandleEx(Exception ex) {
    99       MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);
     99      Progress.Hide(content);
    100100      progress.ProgressStateChanged -= progress_ProgressStateChanged;
    101101      ErrorHandling.ShowErrorDialog("Error uploading tasks", ex);
  • branches/EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r14185 r15477  
    6868        Invoke(new Action(StartProgressView));
    6969      } else {
    70         var message = "Downloading resources. Please be patient.";
    71         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
     70        Progress.ShowMarquee(this, "Downloading resources. Please be patient.");
    7271      }
    7372    }
     
    7776        Invoke(new Action(FinishProgressView));
    7877      } else {
    79         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     78        Progress.Hide(this);
    8079      }
    8180    }
  • branches/EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r14185 r15477  
    109109
    110110        task.ContinueWith((t) => {
    111           MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     111          Progress.Hide(this);
    112112          ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception);
    113113        }, TaskContinuationOptions.OnlyOnFaulted);
     
    120120
    121121    private void DeleteHiveJobsAsync(object items) {
    122       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job...");
     122      Progress.ShowMarquee(this, "Deleting job...");
    123123      foreach (RefreshableJob item in (List<RefreshableJob>)items) {
    124124        Content.Remove(item);
    125125      }
    126       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     126      Progress.Hide(this);
    127127    }
    128128
  • branches/EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r14901 r15477  
    7171      Content.Loaded += new EventHandler(Content_Loaded);
    7272      Content.TaskReceived += new EventHandler(Content_TaskReceived);
    73       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);
     73      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddProgressToView(this, Content.Progress);
    7474    }
    7575
     
    8686      Content.Loaded -= new EventHandler(Content_Loaded);
    8787      Content.TaskReceived -= new EventHandler(Content_TaskReceived);
    88       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);
     88      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveProgressFromView(this, false);
    8989      DeregisterHiveExperimentEvents();
    9090      DeregisterHiveTasksEvents();
     
    137137          }
    138138        }
    139       }
    140       finally {
     139      } finally {
    141140        SuppressEvents = false;
    142141      }
     
    381380
    382381    private void PauseJobAsync(object job) {
    383       Content.Progress.Start("Pausing job...");
     382      Content.Progress.StartMarquee("Pausing job...");
    384383      HiveClient.PauseJob((RefreshableJob)job);
    385384      Content.Progress.Finish();
     
    387386
    388387    private void StopJobAsync(object job) {
    389       Content.Progress.Start("Stopping job...");
     388      Content.Progress.StartMarquee("Stopping job...");
    390389      HiveClient.StopJob((RefreshableJob)job);
    391390      Content.Progress.Finish();
     
    393392
    394393    private void ResumeJobAsync(object job) {
    395       Content.Progress.Start("Resuming job...");
     394      Content.Progress.StartMarquee("Resuming job...");
    396395      HiveClient.ResumeJob((RefreshableJob)job);
    397396      Content.Progress.Finish();
     
    417416        try {
    418417          invoker.EndInvoke(ar);
    419         }
    420         catch (Exception ex) {
    421           ThreadPool.QueueUserWorkItem(delegate(object exception) { ErrorHandling.ShowErrorDialog(this, (Exception)exception); }, ex);
     418        } catch (Exception ex) {
     419          ThreadPool.QueueUserWorkItem(delegate (object exception) { ErrorHandling.ShowErrorDialog(this, (Exception)exception); }, ex);
    422420        }
    423421      }, null);
     
    506504          if (subTask is OptimizerHiveTask) {
    507505            OptimizerHiveTask ohTask = subTask as OptimizerHiveTask;
    508             ohTask.ExecuteReadActionOnItemTask(new Action(delegate() {
     506            ohTask.ExecuteReadActionOnItemTask(new Action(delegate () {
    509507              runs.AddRange(ohTask.ItemTask.Item.Runs);
    510508            }));
Note: See TracChangeset for help on using the changeset viewer.