- Timestamp:
- 04/07/16 15:26:47 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3
- Files:
-
- 2 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/HeuristicLab.OptimizationExpertSystem-3.3.csproj
r13743 r13748 191 191 <DependentUpon>AlgorithmControlForm.cs</DependentUpon> 192 192 </Compile> 193 <Compile Include="Toolbar\DownloadFromOKBToolbarItem.cs" /> 194 <Compile Include="Toolbar\ToolbarItemBase.cs" /> 193 195 <Compile Include="Views\KnowledgeCenterAllinOneView.cs"> 194 196 <SubType>UserControl</SubType> -
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 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/OptimizationKnowledgeCenter.cs
r13722 r13748 42 42 43 43 private void ExpertSystemOnDownloadStarted(object sender, EventArgs<IProgress> e) { 44 if (InvokeRequired) { Invoke((Action<object, EventArgs<IProgress>>)ExpertSystemOnDownloadStarted, sender, e); return; } 44 45 e.Value.ProgressStateChanged += OnProgressStateChanged; 45 46 e.Value.ProgressValueChanged += OnProgressValueChanged; … … 52 53 53 54 private void OnProgressStateChanged(object sender, EventArgs e) { 55 if (InvokeRequired) { Invoke((Action<object, EventArgs>)OnProgressStateChanged, sender, e); return; } 54 56 var progress = (IProgress)sender; 55 57 if (progress.ProgressState == ProgressState.Canceled … … 64 66 65 67 private void OnProgressValueChanged(object sender, EventArgs e) { 68 if (InvokeRequired) { Invoke((Action<object, EventArgs>)OnProgressValueChanged, sender, e); return; } 66 69 var progress = (IProgress)sender; 67 70 progressBar.Value = Math.Max(progressBar.Minimum, Math.Min(progressBar.Maximum, (int)(progress.ProgressValue * 100))); … … 69 72 70 73 private void OnProgressStatusChanged(object sender, EventArgs e) { 74 if (InvokeRequired) { Invoke((Action<object, EventArgs>)OnProgressStatusChanged, sender, e); return; } 71 75 var progress = (IProgress)sender; 72 76 progressLabel.Text = progress.Status.Replace(Environment.NewLine, " "); -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Toolbar/ToolbarItemBase.cs
r13739 r13748 22 22 using HeuristicLab.MainForm.WindowsForms; 23 23 24 namespace HeuristicLab.OptimizationExpertSystem. Menu{25 internal abstract class MenuItemBase : MenuItem, IOptimizationKnowledgeCenterUi {24 namespace HeuristicLab.OptimizationExpertSystem.Toolbar { 25 internal abstract class ToolbarItemBase : ToolBarItem, IOptimizationKnowledgeCenterUi { 26 26 public OptimizationKnowledgeCenter MainForm { 27 27 get { return (OptimizationKnowledgeCenter)HeuristicLab.MainForm.MainFormManager.MainForm; }
Note: See TracChangeset
for help on using the changeset viewer.