Changeset 9894 for trunk/sources/HeuristicLab.Clients.Hive.JobManager
- Timestamp:
- 08/22/13 11:31:32 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r9893 r9894 42 42 private ISet<TreeNode> filteredTreeNodes; 43 43 private ISet<TreeNode> nodeStore; 44 private Progress progress; 45 private ProgressView progressView; 46 44 47 45 private ISet<Resource> selectedResources; 48 46 public ISet<Resource> SelectedResources { … … 64 62 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge); 65 63 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge); 66 progress = new Progress(); 67 } 68 69 protected override void DeregisterContentEvents() { 70 if (progressView != null) { 71 progressView.Dispose(); 72 progressView = null; 73 } 74 base.DeregisterContentEvents(); 75 } 76 77 protected override void RegisterContentEvents() { 78 base.RegisterContentEvents(); 79 progressView = new ProgressView(this, progress); 80 } 81 64 } 65 82 66 public void StartProgressView() { 83 67 if (InvokeRequired) { 84 68 Invoke(new Action(StartProgressView)); 85 69 } else { 86 progress.Status= "Downloading resources. Please be patient.";87 progress.ProgressState = ProgressState.Started;70 var message = "Downloading resources. Please be patient."; 71 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message); 88 72 } 89 73 } … … 93 77 Invoke(new Action(FinishProgressView)); 94 78 } else { 95 progress.Finish();79 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 96 80 } 97 81 } -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r9893 r9894 34 34 [Content(typeof(ItemCollection<RefreshableJob>), false)] 35 35 public partial class RefreshableHiveJobListView : HeuristicLab.Core.Views.ItemCollectionView<RefreshableJob> { 36 private Progress progress;37 private ProgressView progressView;38 39 36 public RefreshableHiveJobListView() { 40 37 InitializeComponent(); … … 49 46 50 47 this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending); 51 52 progress = new Progress();53 progressView = new ProgressView(this, progress);54 48 } 55 49 … … 115 109 116 110 task.ContinueWith((t) => { 117 progress.Finish();111 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 118 112 ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception); 119 113 }, TaskContinuationOptions.OnlyOnFaulted); … … 126 120 127 121 private void DeleteHiveJobsAsync(object items) { 128 progress.Start("Deleting job...");122 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job..."); 129 123 foreach (RefreshableJob item in (List<RefreshableJob>)items) { 130 124 Content.Remove(item); 131 125 } 132 progress.Finish();126 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 133 127 } 134 128 … … 222 216 if (disposing) { 223 217 if (components != null) components.Dispose(); 224 progressView.Dispose();225 progressView = null;226 218 } 227 219 base.Dispose(disposing); -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r9893 r9894 42 42 [Content(typeof(RefreshableJob), true)] 43 43 public partial class RefreshableHiveJobView : HeuristicLab.Core.Views.ItemView { 44 private ProgressView progressView;45 44 private HiveResourceSelectorDialog hiveResourceSelectorDialog; 46 45 private bool SuppressEvents { get; set; } … … 72 71 Content.Loaded += new EventHandler(Content_Loaded); 73 72 Content.TaskReceived += new EventHandler(Content_TaskReceived); 74 progressView = new ProgressView(this, Content.Progress);73 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress); 75 74 } 76 75 … … 87 86 Content.Loaded -= new EventHandler(Content_Loaded); 88 87 Content.TaskReceived -= new EventHandler(Content_TaskReceived); 89 if (progressView != null) { 90 progressView.Dispose(); 91 progressView = null; 92 } 88 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false); 93 89 DeregisterHiveExperimentEvents(); 94 90 DeregisterHiveTasksEvents(); … … 251 247 SetEnabledStateOfControls(); 252 248 } 253 private void Content_Prepared(object sender, EventArgs e) { 254 if (InvokeRequired) 255 Invoke(new EventHandler(Content_Prepared), sender, e); 256 else { 257 nameTextBox.Enabled = true; 258 Locked = false; 259 SetEnabledStateOfControls(); 260 } 261 } 262 private void Content_Started(object sender, EventArgs e) { 263 if (InvokeRequired) 264 Invoke(new EventHandler(Content_Started), sender, e); 265 else { 266 nameTextBox.Enabled = false; 267 SetEnabledStateOfControls(); 268 } 269 } 270 private void Content_Paused(object sender, EventArgs e) { 271 if (InvokeRequired) 272 Invoke(new EventHandler(Content_Paused), sender, e); 273 else { 274 nameTextBox.Enabled = true; 275 SetEnabledStateOfControls(); 276 } 277 } 278 private void Content_Stopped(object sender, EventArgs e) { 279 if (InvokeRequired) 280 Invoke(new EventHandler(Content_Stopped), sender, e); 281 else { 282 nameTextBox.Enabled = true; 283 Locked = false; 284 SetEnabledStateOfControls(); 285 } 286 } 249 287 250 private void Content_ExecutionTimeChanged(object sender, EventArgs e) { 288 251 if (InvokeRequired)
Note: See TracChangeset
for help on using the changeset viewer.