- Timestamp:
- 02/04/18 22:33:26 (7 years ago)
- Location:
- branches/1614_GeneralizedQAP/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1614_GeneralizedQAP/HeuristicLab.Optimization.Views/3.3/IOptimizerView.Designer.cs
r15605 r15721 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container();48 47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IOptimizerView)); 49 48 this.startButton = new System.Windows.Forms.Button(); … … 53 52 this.stopButton = new System.Windows.Forms.Button(); 54 53 this.resetButton = new System.Windows.Forms.Button(); 55 this.executionTimer = new System.Windows.Forms.Timer(this.components);56 54 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 57 55 this.SuspendLayout(); … … 134 132 this.resetButton.Click += new System.EventHandler(this.resetButton_Click); 135 133 // 136 // executionTimer137 //138 this.executionTimer.Interval = 200;139 this.executionTimer.Tick += new System.EventHandler(this.executionTimer_Tick);140 //141 134 // IOptimizerView 142 135 // … … 173 166 protected System.Windows.Forms.Button pauseButton; 174 167 protected System.Windows.Forms.Button stopButton; 175 protected System.Windows.Forms.Timer executionTimer;176 168 protected System.Windows.Forms.Button resetButton; 177 169 -
branches/1614_GeneralizedQAP/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs
r15605 r15721 44 44 Content.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred); 45 45 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); 46 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 46 47 Content.Prepared -= new EventHandler(Content_Prepared); 47 48 Content.Started -= new EventHandler(Content_Started); … … 54 55 Content.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred); 55 56 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); 57 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 56 58 Content.Prepared += new EventHandler(Content_Prepared); 57 59 Content.Started += new EventHandler(Content_Started); … … 62 64 protected override void OnContentChanged() { 63 65 base.OnContentChanged(); 64 if (Content != null) { 66 if (Content == null) { 67 executionTimeTextBox.Text = "-"; 68 } else { 65 69 Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started; 70 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 66 71 } 67 UpdateExecutionTime();68 72 } 69 73 … … 86 90 else { 87 91 nameTextBox.Enabled = infoLabel.Enabled = true; 88 UpdateExecutionTime();89 92 ReadOnly = Locked = false; 90 93 SetEnabledStateOfExecutableButtons(); … … 95 98 Invoke(new EventHandler(Content_Started), sender, e); 96 99 else { 97 executionTimer.Start();98 100 nameTextBox.Enabled = infoLabel.Enabled = false; 99 101 ReadOnly = Locked = true; … … 105 107 Invoke(new EventHandler(Content_Paused), sender, e); 106 108 else { 107 executionTimer.Stop();108 UpdateExecutionTime();109 109 nameTextBox.Enabled = infoLabel.Enabled = true; 110 110 ReadOnly = Locked = false; … … 116 116 Invoke(new EventHandler(Content_Stopped), sender, e); 117 117 else { 118 executionTimer.Stop();119 UpdateExecutionTime();120 118 nameTextBox.Enabled = infoLabel.Enabled = true; 121 119 ReadOnly = Locked = false; … … 123 121 } 124 122 } 123 protected virtual void Content_ExecutionTimeChanged(object sender, EventArgs e) { 124 if (InvokeRequired) 125 Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e); 126 else 127 executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString(); 128 } 125 129 protected virtual void Content_ExceptionOccurred(object sender, EventArgs<Exception> e) { 126 130 if (InvokeRequired) 127 131 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e); 128 else { 129 executionTimer.Stop(); 130 UpdateExecutionTime(); 132 else 131 133 ErrorHandling.ShowErrorDialog(this, e.Value); 132 }133 134 } 134 135 #endregion … … 146 147 protected virtual void resetButton_Click(object sender, EventArgs e) { 147 148 Content.Prepare(false); 148 }149 private void executionTimer_Tick(object sender, EventArgs e) {150 UpdateExecutionTime();151 }152 153 private void UpdateExecutionTime() {154 executionTimeTextBox.Text = (Content == null ? "-" : Content.ExecutionTime.ToString());155 149 } 156 150 #endregion
Note: See TracChangeset
for help on using the changeset viewer.