Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/12 16:46:35 (12 years ago)
Author:
gkronber
Message:

#1847: merged r8084:8205 from trunk into GP move operators branch

Location:
branches/GP-MoveOperators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators

  • branches/GP-MoveOperators/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs

    r7782 r8206  
    3131
    3232namespace HeuristicLab.Clients.Hive {
    33   public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, IProgressReporter, IComparable<RefreshableJob> {
     33  public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, IComparable<RefreshableJob> {
    3434    private JobResultPoller jobResultPoller;
    3535    private ConcurrentTaskDownloader<ItemTask> jobDownloader;
    3636    private static object locker = new object();
     37
     38    public bool IsProgressing { get; set; }
    3739
    3840    private Job job;
     
    165167    }
    166168
    167     private bool isProgressing;
    168     public bool IsProgressing {
    169       get { return isProgressing; }
     169    private Progress progress;
     170    public Progress Progress {
     171      get { return progress; }
    170172      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
    183178
    184179    private ThreadSafeLog log;
     
    229224
    230225    #region JobResultPoller Events
    231 
    232226    public void StartResultPolling() {
    233227      if (jobResultPoller == null) {
     
    410404    }
    411405
    412     public event EventHandler IsProgressingChanged;
    413     protected virtual void OnIsProgressingChanged() {
    414       var handler = IsProgressingChanged;
    415       if (handler != null) handler(this, EventArgs.Empty);
    416     }
    417 
    418406    public event EventHandler IsDownloadableChanged;
    419407    private void OnIsDownloadableChanged() {
     
    475463      if (handler != null) handler(this, EventArgs.Empty);
    476464    }
     465    public event EventHandler IsProgressingChanged;
     466    private void OnIsProgressingChanged() {
     467      var handler = IsProgressingChanged;
     468      if (handler != null) handler(this, EventArgs.Empty);
     469    }
    477470    #endregion
    478471
     
    519512    public event EventHandler HiveTasksChanged;
    520513    protected virtual void OnHiveTasksChanged() {
    521       if (jobResultPoller != null && jobResultPoller.IsPolling) {
    522         jobResultPoller.Stop();
    523         DeregisterResultPollingEvents();
    524       }
     514      StopResultPolling();
    525515      if (this.HiveTasks != null && this.HiveTasks.Count > 0 && this.GetAllHiveTasks().All(x => x.Task.Id != Guid.Empty)) {
    526516        if (IsFinished()) {
    527517          this.ExecutionState = Core.ExecutionState.Stopped;
    528518          this.RefreshAutomatically = false;
    529         }
    530 
    531         if (this.RefreshAutomatically) {
    532           StartResultPolling();
     519          if (jobResultPoller != null) DeregisterResultPollingEvents();
     520        } else {
     521          this.RefreshAutomatically = true;
    533522        }
    534523      }
Note: See TracChangeset for help on using the changeset viewer.