- Timestamp:
- 04/07/16 15:26:47 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Menu/0_Config/30_DownloadFromOkbMenuItem.cs
r13720 r13748 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Common.Resources; 24 using HeuristicLab.MainForm; 23 25 using System; 24 26 using System.Collections.Generic; … … 41 43 } 42 44 43 public override string ToolTipText { get { return "Download relevant runs from the knowledge base."; } } 45 public override string ToolTipText { 46 get { 47 return @"Download relevant runs, including algorithm instances 48 and problem instances from the OKB server."; 49 } 50 } 44 51 45 52 public override void Execute() { … … 51 58 ToolStripItem.Enabled = MainForm.ExpertSystem.Problem.ProblemId != -1; 52 59 MainForm.ExpertSystem.Problem.ProblemChanged += OnProblemChanged; 60 MainForm.ExpertSystem.DownloadStarted += OnDownloadStarted; 53 61 } 54 62 … … 56 64 ToolStripItem.Enabled = MainForm.ExpertSystem.Problem.ProblemId != -1; 57 65 } 66 67 private void OnDownloadStarted(object sender, EventArgs<IProgress> e) { 68 ToolStripItem.Enabled = false; 69 e.Value.ProgressStateChanged += DownloadProgressOnStateChanged; 70 } 71 72 private void DownloadProgressOnStateChanged(object sender, EventArgs eventArgs) { 73 var progress = (IProgress)sender; 74 if (progress.ProgressState == ProgressState.Finished || progress.ProgressState == ProgressState.Canceled) { 75 ToolStripItem.Enabled = true; 76 progress.ProgressStateChanged -= DownloadProgressOnStateChanged; 77 } 78 } 58 79 } 59 80 }
Note: See TracChangeset
for help on using the changeset viewer.