- Timestamp:
- 09/04/17 12:46:43 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.cs
r15342 r15346 1 1 using System; 2 using System.Collections.Generic; 2 3 using System.Threading.Tasks; 3 4 using System.Windows.Forms; 5 using HeuristicLab.Clients.Hive; 4 6 using HeuristicLab.Common; 5 7 using HeuristicLab.Core; … … 10 12 InitializeComponent(); 11 13 ContentManager.Initialize(new PersistenceContentManager()); 14 ListHiveJobs(); 12 15 } 13 16 14 private Task task;17 private System.Threading.Tasks.Task task; 15 18 16 19 public static ThreadSafeLog Log = new ThreadSafeLog(); … … 30 33 31 34 JobDownloader jobDownloader = new JobDownloader(Environment.CurrentDirectory, pattern, Log, oneFileCheckBox.Checked); 32 task = new Task(jobDownloader.Start);35 task = new System.Threading.Tasks.Task(jobDownloader.Start); 33 36 task.ContinueWith(x => { Log.LogMessage("All tasks written, quitting."); EnableButton(); }, TaskContinuationOptions.OnlyOnRanToCompletion); 34 37 task.ContinueWith(x => { Log.LogMessage("Unexpected Exception while draining the Hive: " + x.Exception.ToString()); EnableButton(); }, TaskContinuationOptions.OnlyOnFaulted); … … 39 42 //TODO: implement task cancelation 40 43 } 44 45 private void ListHiveJobs() { 46 if (logView.Content == null) 47 logView.Content = Log; 48 Log.Clear(); 49 var jobs = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs()); 50 foreach (var job in jobs) { 51 Log.LogMessage(string.Format("{0}\t{1}", job.DateCreated, job.Name)); 52 } 53 } 41 54 } 42 55 }
Note: See TracChangeset
for help on using the changeset viewer.