Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/28/12 12:00:51 (12 years ago)
Author:
ascheibe
Message:

#1762 implemented review comments:

  • removed self disposing. The progress view now reacts if a progress is set and Finish() is now called on the progress object and not the view.
  • Moved Cancel event from ProgressView to Progress
  • throw ArgumentNullException if the parent view is null
Location:
trunk/sources/HeuristicLab.MainForm/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm/3.3/Interfaces/IProgress.cs

    r7582 r8145  
    2828
    2929    void Finish();
     30    void SignalSuccessfulCancelation();
    3031
    3132    event EventHandler Finished;
    3233    event EventHandler StatusChanged;
    3334    event EventHandler ProgressValueChanged;
     35
     36    bool CancelRequested { get; set; }
     37    event EventHandler Canceled;
     38
     39
    3440  }
    3541}
  • trunk/sources/HeuristicLab.MainForm/3.3/Progress.cs

    r7582 r8145  
    3737    }
    3838
     39    public bool CancelRequested { get; set; }
     40
    3941    private double progressValue;
    4042    public double ProgressValue {
     
    6062    }
    6163
     64    public void SignalSuccessfulCancelation() {
     65      OnCanceled();
     66    }
     67
    6268    #region Event Handler
     69    public event EventHandler Canceled;
     70    private void OnCanceled() {
     71      var handler = Canceled;
     72      try {
     73        if (handler != null) handler(this, EventArgs.Empty);
     74      }
     75      catch (Exception) { }
     76    }
     77
    6378    public event EventHandler Finished;
    6479    private void OnFinished() {
Note: See TracChangeset for help on using the changeset viewer.