Changeset 4070 for trunk/sources
- Timestamp:
- 07/22/10 04:27:50 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r4068 r4070 70 70 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 71 71 Content.Prepared -= new EventHandler(Content_Prepared); 72 Content.Started -= new EventHandler(Content_Started); 73 Content.Paused -= new EventHandler(Content_Paused); 74 Content.Stopped -= new EventHandler(Content_Stopped); 72 75 Content.ProblemChanged -= new EventHandler(Content_ProblemChanged); 73 76 base.DeregisterContentEvents(); … … 79 82 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 80 83 Content.Prepared += new EventHandler(Content_Prepared); 84 Content.Started += new EventHandler(Content_Started); 85 Content.Paused += new EventHandler(Content_Paused); 86 Content.Stopped += new EventHandler(Content_Stopped); 81 87 Content.ProblemChanged += new EventHandler(Content_ProblemChanged); 82 88 } … … 126 132 } 127 133 } 134 protected virtual void Content_ExecutionStateChanged(object sender, EventArgs e) { 135 if (InvokeRequired) 136 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 137 else 138 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false; 139 } 128 140 protected virtual void Content_Prepared(object sender, EventArgs e) { 129 141 if (InvokeRequired) 130 142 Invoke(new EventHandler(Content_Prepared), sender, e); 131 else 143 else { 132 144 resultsView.Content = Content.Results.AsReadOnly(); 133 } 134 protected virtual void Content_ExecutionStateChanged(object sender, EventArgs e) { 135 if (InvokeRequired) 136 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 137 else { 138 ReadOnly = Content.ExecutionState == ExecutionState.Started; 139 Locked = Content.ExecutionState == ExecutionState.Started; 145 ReadOnly = Locked = false; 146 SetEnabledStateOfExecutableButtons(); 147 } 148 } 149 protected virtual void Content_Started(object sender, EventArgs e) { 150 if (InvokeRequired) 151 Invoke(new EventHandler(Content_Started), sender, e); 152 else { 153 ReadOnly = Locked = true; 154 SetEnabledStateOfExecutableButtons(); 155 } 156 } 157 protected virtual void Content_Paused(object sender, EventArgs e) { 158 if (InvokeRequired) 159 Invoke(new EventHandler(Content_Paused), sender, e); 160 else { 161 ReadOnly = Locked = false; 162 SetEnabledStateOfExecutableButtons(); 163 } 164 } 165 protected virtual void Content_Stopped(object sender, EventArgs e) { 166 if (InvokeRequired) 167 Invoke(new EventHandler(Content_Stopped), sender, e); 168 else { 169 ReadOnly = Locked = false; 140 170 SetEnabledStateOfExecutableButtons(); 141 171 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs
r4068 r4070 54 54 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); 55 55 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 56 Content.Prepared -= new EventHandler(Content_Prepared); 57 Content.Started -= new EventHandler(Content_Started); 58 Content.Paused -= new EventHandler(Content_Paused); 59 Content.Stopped -= new EventHandler(Content_Stopped); 56 60 Content.RepetitionsChanged -= new EventHandler(Content_RepetitionsChanged); 57 61 base.DeregisterContentEvents(); … … 63 67 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); 64 68 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 69 Content.Prepared += new EventHandler(Content_Prepared); 70 Content.Started += new EventHandler(Content_Started); 71 Content.Paused += new EventHandler(Content_Paused); 72 Content.Stopped += new EventHandler(Content_Stopped); 65 73 Content.RepetitionsChanged += new EventHandler(Content_RepetitionsChanged); 66 74 } … … 100 108 if (InvokeRequired) 101 109 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 102 else { 103 this.ReadOnly = Content.ExecutionState == ExecutionState.Started; 104 Locked = Content.ExecutionState == ExecutionState.Started; 110 else 111 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false; 112 } 113 private void Content_Prepared(object sender, EventArgs e) { 114 if (InvokeRequired) 115 Invoke(new EventHandler(Content_Prepared), sender, e); 116 else { 117 ReadOnly = Locked = false; 118 SetEnabledStateOfExecutableButtons(); 119 } 120 } 121 private void Content_Started(object sender, EventArgs e) { 122 if (InvokeRequired) 123 Invoke(new EventHandler(Content_Started), sender, e); 124 else { 125 ReadOnly = Locked = true; 126 SetEnabledStateOfExecutableButtons(); 127 } 128 } 129 private void Content_Paused(object sender, EventArgs e) { 130 if (InvokeRequired) 131 Invoke(new EventHandler(Content_Paused), sender, e); 132 else { 133 ReadOnly = Locked = false; 134 SetEnabledStateOfExecutableButtons(); 135 } 136 } 137 private void Content_Stopped(object sender, EventArgs e) { 138 if (InvokeRequired) 139 Invoke(new EventHandler(Content_Stopped), sender, e); 140 else { 141 ReadOnly = Locked = false; 105 142 SetEnabledStateOfExecutableButtons(); 106 143 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.cs
r3904 r4070 51 51 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); 52 52 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 53 Content.Prepared -= new EventHandler(Content_Prepared); 54 Content.Started -= new EventHandler(Content_Started); 55 Content.Paused -= new EventHandler(Content_Paused); 56 Content.Stopped -= new EventHandler(Content_Stopped); 53 57 base.DeregisterContentEvents(); 54 58 } … … 58 62 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); 59 63 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 64 Content.Prepared += new EventHandler(Content_Prepared); 65 Content.Started += new EventHandler(Content_Started); 66 Content.Paused += new EventHandler(Content_Paused); 67 Content.Stopped += new EventHandler(Content_Stopped); 60 68 } 61 69 … … 90 98 if (InvokeRequired) 91 99 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 100 else 101 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false; 102 } 103 private void Content_Prepared(object sender, EventArgs e) { 104 if (InvokeRequired) 105 Invoke(new EventHandler(Content_Prepared), sender, e); 92 106 else { 93 nameTextBox.Enabled = Content.ExecutionState != ExecutionState.Started; 94 descriptionTextBox.Enabled = Content.ExecutionState != ExecutionState.Started; 95 Locked = Content.ExecutionState == ExecutionState.Started; 107 nameTextBox.Enabled = descriptionTextBox.Enabled = true; 108 Locked = false; 109 SetEnabledStateOfExecutableButtons(); 110 } 111 } 112 private void Content_Started(object sender, EventArgs e) { 113 if (InvokeRequired) 114 Invoke(new EventHandler(Content_Started), sender, e); 115 else { 116 nameTextBox.Enabled = descriptionTextBox.Enabled = false; 117 Locked = true; 118 SetEnabledStateOfExecutableButtons(); 119 } 120 } 121 private void Content_Paused(object sender, EventArgs e) { 122 if (InvokeRequired) 123 Invoke(new EventHandler(Content_Paused), sender, e); 124 else { 125 nameTextBox.Enabled = descriptionTextBox.Enabled = true; 126 Locked = false; 127 SetEnabledStateOfExecutableButtons(); 128 } 129 } 130 private void Content_Stopped(object sender, EventArgs e) { 131 if (InvokeRequired) 132 Invoke(new EventHandler(Content_Stopped), sender, e); 133 else { 134 nameTextBox.Enabled = descriptionTextBox.Enabled = true; 135 Locked = false; 96 136 SetEnabledStateOfExecutableButtons(); 97 137 }
Note: See TracChangeset
for help on using the changeset viewer.