Changeset 6200 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager
- Timestamp:
- 05/16/11 00:18:48 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.cs
r6178 r6200 46 46 protected override void RegisterContentEvents() { 47 47 base.RegisterContentEvents(); 48 Content. JobItemChanged += new EventHandler(Content_JobItemChanged);48 Content.ItemJobChanged += new EventHandler(Content_JobItemChanged); 49 49 Content.JobChanged += new EventHandler(Content_JobChanged); 50 50 Content.JobStateChanged += new EventHandler(Content_JobStateChanged); … … 52 52 53 53 protected override void DeregisterContentEvents() { 54 Content. JobItemChanged -= new EventHandler(Content_JobItemChanged);54 Content.ItemJobChanged -= new EventHandler(Content_JobItemChanged); 55 55 Content.JobChanged -= new EventHandler(Content_JobChanged); 56 56 Content.JobStateChanged -= new EventHandler(Content_JobStateChanged); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/RefreshableHiveExperimentView.cs
r6198 r6200 21 21 22 22 using System; 23 using System.ComponentModel;24 23 using System.Linq; 25 24 using System.Threading; … … 58 57 base.RegisterContentEvents(); 59 58 Content.RefreshAutomaticallyChanged += new EventHandler(Content_RefreshAutomaticallyChanged); 60 Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Content_PropertyChanged);61 59 Content.HiveExperimentChanged += new EventHandler(Content_HiveExperimentChanged); 62 60 Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged); 63 } 61 Content.JobStatisticsChanged += new EventHandler(Content_JobStatisticsChanged); 62 } 63 64 64 protected override void DeregisterContentEvents() { 65 65 Content.RefreshAutomaticallyChanged -= new EventHandler(Content_RefreshAutomaticallyChanged); 66 Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(Content_PropertyChanged);67 66 Content.HiveExperimentChanged -= new EventHandler(Content_HiveExperimentChanged); 68 67 Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged); 68 Content.JobStatisticsChanged -= new EventHandler(Content_JobStatisticsChanged); 69 69 base.DeregisterContentEvents(); 70 70 } … … 104 104 //includeJobsCheckBox.Checked = false; 105 105 refreshAutomaticallyCheckBox.Checked = false; 106 jobsTextBox.Text = "0";107 calculatingTextBox.Text = "0";108 finishedTextBox.Text = "0";109 106 logView.Content = null; 110 107 } else { … … 115 112 //includeJobsCheckBox.Checked = Content.IncludeJobs; 116 113 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; 117 jobsTextBox.Text = Content.HiveExperiment.JobCount.ToString();118 calculatingTextBox.Text = Content.HiveExperiment.CalculatingCount.ToString();119 finishedTextBox.Text = Content.HiveExperiment.FinishedCount.ToString();120 114 logView.Content = Content.Log; 121 115 } 116 Content_JobStatisticsChanged(this, EventArgs.Empty); 122 117 Content_HiveExperimentChanged(this, EventArgs.Empty); 123 118 Content_HiveJobChanged(this, EventArgs.Empty); … … 233 228 } 234 229 235 private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {236 if (InvokeRequired)237 Invoke(new PropertyChangedEventHandler(Content_PropertyChanged), sender, e);238 else {239 jobsTextBox.Text = Content.HiveExperiment.JobCount.ToString();240 calculatingTextBox.Text = Content.HiveExperiment.CalculatingCount.ToString();241 finishedTextBox.Text = Content.HiveExperiment.FinishedCount.ToString();242 }243 }244 245 230 private void Content_HiveExperimentChanged(object sender, EventArgs e) { 246 231 if (Content.HiveExperiment != null) { … … 252 237 SetEnabledStateOfControls(); 253 238 } 239 private void Content_JobStatisticsChanged(object sender, EventArgs e) { 240 if (InvokeRequired) 241 Invoke(new EventHandler(Content_JobStatisticsChanged), sender, e); 242 else { 243 if (Content != null) { 244 jobsTextBox.Text = Content.HiveExperiment.JobCount.ToString(); 245 calculatingTextBox.Text = Content.HiveExperiment.CalculatingCount.ToString(); 246 finishedTextBox.Text = Content.HiveExperiment.FinishedCount.ToString(); 247 } else { 248 jobsTextBox.Text = "0"; 249 calculatingTextBox.Text = "0"; 250 finishedTextBox.Text = "0"; 251 } 252 } 253 } 254 254 #endregion 255 255 256 256 #region Control events 257 257 private void startButton_Click(object sender, EventArgs e) { 258 ExperimentManagerClient.StartExperiment( new Action<Exception>((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Start failed.", ex)), Content);258 ExperimentManagerClient.StartExperiment((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Start failed.", ex), Content); 259 259 } 260 260 private void pauseButton_Click(object sender, EventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.