- Timestamp:
- 07/03/12 16:46:35 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:mergeinfo changed
/trunk/sources merged: 8084,8088-8090,8092-8100,8102-8113,8115,8117-8132,8134-8146,8148-8156,8158-8160,8163-8170,8173-8176,8178-8190,8192-8205
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs
r7782 r8206 31 31 32 32 namespace HeuristicLab.Clients.Hive { 33 public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, I ProgressReporter, IComparable<RefreshableJob> {33 public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, IComparable<RefreshableJob> { 34 34 private JobResultPoller jobResultPoller; 35 35 private ConcurrentTaskDownloader<ItemTask> jobDownloader; 36 36 private static object locker = new object(); 37 38 public bool IsProgressing { get; set; } 37 39 38 40 private Job job; … … 165 167 } 166 168 167 private bool isProgressing;168 public bool IsProgressing{169 get { return isProgressing; }169 private Progress progress; 170 public Progress Progress { 171 get { return progress; } 170 172 set { 171 if (isProgressing != value) { 172 isProgressing = value; 173 OnIsProgressingChanged(); 174 } 175 } 176 } 177 178 private IProgress progress; 179 public IProgress Progress { 180 get { return progress; } 181 set { this.progress = value; } 182 } 173 this.progress = value; 174 OnIsProgressingChanged(); 175 } 176 } 177 183 178 184 179 private ThreadSafeLog log; … … 229 224 230 225 #region JobResultPoller Events 231 232 226 public void StartResultPolling() { 233 227 if (jobResultPoller == null) { … … 410 404 } 411 405 412 public event EventHandler IsProgressingChanged;413 protected virtual void OnIsProgressingChanged() {414 var handler = IsProgressingChanged;415 if (handler != null) handler(this, EventArgs.Empty);416 }417 418 406 public event EventHandler IsDownloadableChanged; 419 407 private void OnIsDownloadableChanged() { … … 475 463 if (handler != null) handler(this, EventArgs.Empty); 476 464 } 465 public event EventHandler IsProgressingChanged; 466 private void OnIsProgressingChanged() { 467 var handler = IsProgressingChanged; 468 if (handler != null) handler(this, EventArgs.Empty); 469 } 477 470 #endregion 478 471 … … 519 512 public event EventHandler HiveTasksChanged; 520 513 protected virtual void OnHiveTasksChanged() { 521 if (jobResultPoller != null && jobResultPoller.IsPolling) { 522 jobResultPoller.Stop(); 523 DeregisterResultPollingEvents(); 524 } 514 StopResultPolling(); 525 515 if (this.HiveTasks != null && this.HiveTasks.Count > 0 && this.GetAllHiveTasks().All(x => x.Task.Id != Guid.Empty)) { 526 516 if (IsFinished()) { 527 517 this.ExecutionState = Core.ExecutionState.Stopped; 528 518 this.RefreshAutomatically = false; 529 } 530 531 if (this.RefreshAutomatically) { 532 StartResultPolling(); 519 if (jobResultPoller != null) DeregisterResultPollingEvents(); 520 } else { 521 this.RefreshAutomatically = true; 533 522 } 534 523 }
Note: See TracChangeset
for help on using the changeset viewer.