- Timestamp:
- 07/18/14 12:35:00 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 2 deleted
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll11 10 HeuristicLab 3.3.5.1.ReSharper.user 12 11 HeuristicLab 3.3.6.0.ReSharper.user 13 12 HeuristicLab.4.5.resharper.user 14 13 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development16 14 HeuristicLab.resharper.user 17 15 ProtoGen.exe … … 19 17 _ReSharper.HeuristicLab 20 18 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests22 19 _ReSharper.HeuristicLab.ExtLibs 23 20 bin 24 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ExtensionMethods/TreeNodeExtensions.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj
r11202 r11203 98 98 <Compile Include="ExtensionMethods\TreeNodeExtensions.cs" /> 99 99 <Compile Include="ListViewItemDateComparer.cs" /> 100 <Compile Include="MenuItems\CreateHiveJobMenuItem.cs" />101 <Compile Include="MenuItems\RunInHiveMenuItem.cs" />102 100 <Compile Include="Plugin.cs" /> 103 101 <Compile Include="Views\HiveJobManagerView.cs"> -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ListViewItemDateComparer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 public class ListViewItemDateComparer : IComparer { 32 32 private int col; 33 p ublic SortOrder Order { get; set; }33 private SortOrder order; 34 34 35 35 public ListViewItemDateComparer() { 36 36 col = 0; 37 Order = SortOrder.Ascending;37 order = SortOrder.Ascending; 38 38 } 39 39 40 40 public ListViewItemDateComparer(int column, SortOrder order) { 41 41 col = column; 42 Order = order;42 this.order = order; 43 43 } 44 44 … … 66 66 } 67 67 68 if ( Order == SortOrder.Descending) {68 if (order == SortOrder.Descending) { 69 69 // invert the value returned by Compare. 70 70 returnVal *= -1; -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/JobManagerMenuItem.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System.Collections.Generic; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Clients.Hive; 24 25 using HeuristicLab.MainForm; 25 using HeuristicLab.Optimizer;26 26 27 namespace HeuristicLab. Clients.Hive.JobManager{27 namespace HeuristicLab.Optimizer.MenuItems { 28 28 public class JobManagerMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider { 29 29 public override string Name { -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Plugin.cs.frame
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 24 24 namespace HeuristicLab.Clients.Hive.JobManager { 25 [Plugin("HeuristicLab.Clients.Hive.JobManager", "3.3. 10.$WCREV$")]25 [Plugin("HeuristicLab.Clients.Hive.JobManager", "3.3.7.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Clients.Hive.JobManager-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Clients.Hive", "3.3")] -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Properties/AssemblyInfo.cs.frame
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("HEAL")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 4HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2012 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3. 10.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")] -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.Designer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.Designer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.Designer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.Designer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 42 42 private ISet<TreeNode> filteredTreeNodes; 43 43 private ISet<TreeNode> nodeStore; 44 44 private Progress progress; 45 private ProgressView progressView; 46 45 47 private ISet<Resource> selectedResources; 46 48 public ISet<Resource> SelectedResources { … … 62 64 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge); 63 65 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge); 64 } 65 66 progress = new Progress() { 67 CanBeCanceled = false, 68 ProgressState = ProgressState.Finished 69 }; 70 } 71 72 protected override void DeregisterContentEvents() { 73 if (progressView != null) { 74 progressView.Content = null; 75 progressView.Dispose(); 76 progressView = null; 77 } 78 base.DeregisterContentEvents(); 79 } 80 81 protected override void RegisterContentEvents() { 82 base.RegisterContentEvents(); 83 progressView = new ProgressView(this, progress); 84 } 85 66 86 public void StartProgressView() { 67 87 if (InvokeRequired) { 68 88 Invoke(new Action(StartProgressView)); 69 89 } else { 70 var message= "Downloading resources. Please be patient.";71 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);90 progress.Status = "Downloading resources. Please be patient."; 91 progress.ProgressState = ProgressState.Started; 72 92 } 73 93 } … … 77 97 Invoke(new Action(FinishProgressView)); 78 98 } else { 79 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);99 progress.Finish(); 80 100 } 81 101 } -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.Designer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.Designer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 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 36 39 public RefreshableHiveJobListView() { 37 40 InitializeComponent(); … … 41 44 this.itemsListView.Columns.Add(new ColumnHeader("Date") { Text = "Date" }); 42 45 this.itemsListView.Columns.Add(new ColumnHeader("Name") { Text = "Name" }); 43 46 foreach (ColumnHeader c in this.itemsListView.Columns) { 47 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 48 } 44 49 this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable; 45 50 this.itemsListView.FullRowSelect = true; 46 51 47 52 this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending); 48 }49 50 protected override void SortItemsListView(SortOrder sortOrder) { 51 if (itemsListView.Sorting == sortOrder || sortOrder == SortOrder.None) return;52 ((ListViewItemDateComparer)itemsListView.ListViewItemSorter).Order = sortOrder;53 itemsListView.Sorting = sortOrder;54 itemsListView.Sort();55 AdjustListViewColumnSizes();53 this.itemsListView.Sorting = SortOrder.Ascending; 54 this.itemsListView.Sort(); 55 56 progress = new Progress() { 57 CanBeCanceled = false, 58 ProgressState = ProgressState.Finished 59 }; 60 progressView = new ProgressView(this, progress); 56 61 } 57 62 … … 109 114 110 115 task.ContinueWith((t) => { 111 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);116 progress.Finish(); 112 117 ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception); 113 118 }, TaskContinuationOptions.OnlyOnFaulted); … … 120 125 121 126 private void DeleteHiveJobsAsync(object items) { 122 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job..."); 127 progress.Status = "Deleting job..."; 128 progress.ProgressState = ProgressState.Started; 129 progress.ProgressValue = 0.0; 123 130 foreach (RefreshableJob item in (List<RefreshableJob>)items) { 124 131 Content.Remove(item); 125 132 } 126 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);133 progress.Finish(); 127 134 } 128 135 … … 216 223 if (disposing) { 217 224 if (components != null) components.Dispose(); 225 progressView.Content = null; 226 progressView.Dispose(); 218 227 } 219 228 base.Dispose(disposing); -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 42 42 [Content(typeof(RefreshableJob), true)] 43 43 public partial class RefreshableHiveJobView : HeuristicLab.Core.Views.ItemView { 44 private Progress progress; 45 private ProgressView progressView; 44 46 private HiveResourceSelectorDialog hiveResourceSelectorDialog; 45 47 private bool SuppressEvents { get; set; } … … 56 58 public RefreshableHiveJobView() { 57 59 InitializeComponent(); 60 progress = new Progress() { 61 CanBeCanceled = false, 62 ProgressState = ProgressState.Finished 63 }; 58 64 } 59 65 … … 66 72 Content.ExceptionOccured += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured); 67 73 Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged); 74 Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged); 68 75 Content.HiveTasksChanged += new EventHandler(Content_HiveTasksChanged); 69 76 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); … … 71 78 Content.Loaded += new EventHandler(Content_Loaded); 72 79 Content.TaskReceived += new EventHandler(Content_TaskReceived); 73 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);80 progressView = new ProgressView(this, progress); 74 81 } 75 82 … … 81 88 Content.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured); 82 89 Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged); 90 Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged); 83 91 Content.HiveTasksChanged -= new EventHandler(Content_HiveTasksChanged); 84 92 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); … … 86 94 Content.Loaded -= new EventHandler(Content_Loaded); 87 95 Content.TaskReceived -= new EventHandler(Content_TaskReceived); 88 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false); 96 if (progressView != null) { 97 progressView.Content = null; 98 progressView.Dispose(); 99 progressView = null; 100 } 89 101 DeregisterHiveExperimentEvents(); 90 102 DeregisterHiveTasksEvents(); … … 147 159 Content_HiveExperimentChanged(this, EventArgs.Empty); 148 160 Content_HiveTasksChanged(this, EventArgs.Empty); 161 Content_IsProgressingChanged(this, EventArgs.Empty); 149 162 Content_StateLogListChanged(this, EventArgs.Empty); 150 163 HiveExperiment_PropertyChanged(this, new PropertyChangedEventArgs("Id")); … … 247 260 SetEnabledStateOfControls(); 248 261 } 249 262 private void Content_Prepared(object sender, EventArgs e) { 263 if (InvokeRequired) 264 Invoke(new EventHandler(Content_Prepared), sender, e); 265 else { 266 nameTextBox.Enabled = true; 267 Locked = false; 268 SetEnabledStateOfControls(); 269 } 270 } 271 private void Content_Started(object sender, EventArgs e) { 272 if (InvokeRequired) 273 Invoke(new EventHandler(Content_Started), sender, e); 274 else { 275 nameTextBox.Enabled = false; 276 SetEnabledStateOfControls(); 277 } 278 } 279 private void Content_Paused(object sender, EventArgs e) { 280 if (InvokeRequired) 281 Invoke(new EventHandler(Content_Paused), sender, e); 282 else { 283 nameTextBox.Enabled = true; 284 SetEnabledStateOfControls(); 285 } 286 } 287 private void Content_Stopped(object sender, EventArgs e) { 288 if (InvokeRequired) 289 Invoke(new EventHandler(Content_Stopped), sender, e); 290 else { 291 nameTextBox.Enabled = true; 292 Locked = false; 293 SetEnabledStateOfControls(); 294 } 295 } 250 296 private void Content_ExecutionTimeChanged(object sender, EventArgs e) { 251 297 if (InvokeRequired) … … 280 326 runCollectionViewHost.Content = GetAllRunsFromJob(Content); 281 327 } 282 if (InvokeRequired) { 283 Invoke(new Action(() => { isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged; })); 284 } else { 285 isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged; 286 } 328 isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged; 287 329 } 288 330 … … 290 332 if (Content != null && Content.Job != null) { 291 333 RegisterHiveExperimentEvents(); 334 Content_IsProgressingChanged(sender, e); 292 335 } 293 336 } … … 363 406 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeJobAsync, Content); 364 407 task.ContinueWith((t) => { 365 Content.Progress.Finish();408 progress.Finish(); 366 409 MessageBox.Show("An error occured resuming the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 367 410 Content.Log.LogException(t.Exception); … … 375 418 var task = System.Threading.Tasks.Task.Factory.StartNew(PauseJobAsync, Content); 376 419 task.ContinueWith((t) => { 377 Content.Progress.Finish();420 progress.Finish(); 378 421 MessageBox.Show("An error occured pausing the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 379 422 Content.Log.LogException(t.Exception); … … 384 427 var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobAsync, Content); 385 428 task.ContinueWith((t) => { 386 Content.Progress.Finish();429 progress.Finish(); 387 430 MessageBox.Show("An error occured stopping the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 388 431 Content.Log.LogException(t.Exception); … … 392 435 393 436 private void PauseJobAsync(object job) { 394 Content.Progress.Start("Pausing job..."); 437 progress.Status = "Pausing job..."; 438 progress.ProgressState = ProgressState.Started; 395 439 HiveClient.PauseJob((RefreshableJob)job); 396 Content.Progress.Finish();440 progress.Finish(); 397 441 } 398 442 399 443 private void StopJobAsync(object job) { 400 Content.Progress.Start("Stopping job..."); 444 progress.Status = "Stopping job..."; 445 progress.ProgressState = ProgressState.Started; 401 446 HiveClient.StopJob((RefreshableJob)job); 402 Content.Progress.Finish();447 progress.Finish(); 403 448 } 404 449 405 450 private void ResumeJobAsync(object job) { 406 Content.Progress.Start("Resuming job..."); 451 progress.Status = "Resuming job..."; 452 progress.ProgressState = ProgressState.Started; 407 453 HiveClient.ResumeJob((RefreshableJob)job); 408 Content.Progress.Finish();454 progress.Finish(); 409 455 } 410 456 … … 461 507 #endregion 462 508 509 #region Progress reporting 510 private void Content_IsProgressingChanged(object sender, EventArgs e) { 511 if (this.InvokeRequired) { 512 Invoke(new EventHandler(Content_IsProgressingChanged), sender, e); 513 } else { 514 if (Content != null && Content.Progress != null && Content.IsProgressing) { 515 progressView.Content = Content.Progress; 516 } else if (Content != null) { 517 progressView.Content = progress; 518 } 519 } 520 } 521 #endregion 522 463 523 #region Drag & Drop 464 524 private void jobsTreeView_DragOver(object sender, DragEventArgs e) { … … 468 528 private void jobsTreeView_DragEnter(object sender, DragEventArgs e) { 469 529 e.Effect = DragDropEffects.None; 470 var obj = (IDeepCloneable)e.Data.GetData(Constants.DragDropDataFormat); 471 472 Type objType = obj.GetType(); 473 if (ItemTask.IsTypeSupported(objType)) { 530 var obj = e.Data.GetData(Constants.DragDropDataFormat); 531 if (obj is IOptimizer) { 474 532 if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None; 475 533 else if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key … … 480 538 private void jobsTreeView_DragDrop(object sender, DragEventArgs e) { 481 539 if (e.Effect != DragDropEffects.None) { 482 var obj = (IItem)e.Data.GetData(Constants.DragDropDataFormat); 483 484 IItem newObj = null; 485 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 486 newObj = (IItem)obj.Clone(); 487 } else { 488 newObj = obj; 489 } 490 491 //IOptimizer and IExecutables need some special care 492 if (newObj is IOptimizer) { 493 ((IOptimizer)newObj).Runs.Clear(); 494 } 495 if (newObj is IExecutable) { 496 IExecutable exec = (IExecutable)newObj; 497 if (exec.ExecutionState != ExecutionState.Prepared) { 498 exec.Prepare(); 540 var obj = e.Data.GetData(Constants.DragDropDataFormat); 541 542 var optimizer = obj as IOptimizer; 543 if (optimizer != null) { 544 IOptimizer newOptimizer = null; 545 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 546 newOptimizer = (IOptimizer)optimizer.Clone(); 547 newOptimizer.Runs.Clear(); 548 } else { 549 newOptimizer = optimizer; 499 550 } 500 } 501 502 ItemTask hiveTask = ItemTask.GetItemTaskForItem(newObj); 503 Content.HiveTasks.Add(hiveTask.CreateHiveTask()); 551 if (newOptimizer.ExecutionState != ExecutionState.Prepared) { 552 newOptimizer.Prepare(); 553 } 554 555 Content.HiveTasks.Add(new OptimizerHiveTask(newOptimizer)); 556 } 504 557 } 505 558 }
Note: See TracChangeset
for help on using the changeset viewer.