Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/22/13 11:31:32 (11 years ago)
Author:
ascheibe
Message:

#1042

  • changed Hive views to use MainForm for progress handling
  • removed Cancel timeout
  • setter for ProgressState is now private
  • added Start methods to Progress
  • removed unused methods from RefreshableHiveJobView
Location:
trunk/sources/HeuristicLab.MainForm/3.3
Files:
2 edited

Legend:

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

    r9893 r9894  
    4141    /// If it is reused it may be Started again.
    4242    /// </summary>
    43     ProgressState ProgressState { get; set; }
     43    ProgressState ProgressState { get; }
    4444    /// <summary>
    4545    /// Returns whether the operation can be canceled or not.
     
    5454    /// </summary>
    5555    /// <exception cref="NotSupportedException">Thrown when cancellation is not supported.</exception>
    56     /// <param name="timeoutMs">The operation is given a certain timeout to cancel. If the operation doesn't cancel in this time it will be forcibly closed.</param>
    57     void Cancel(int timeoutMs = 0);
     56    void Cancel();
    5857    /// <summary>
    5958    /// Sets the ProgressValue to 1 and the ProgressState to Finished.
     
    6160    void Finish();
    6261
     62    /// <summary>
     63    /// Starts or restarts a Progress.
     64    /// </summary>
     65    void Start();
     66
    6367    void Start(string status);
    64 
    65     void Start();
    6668
    6769    /// <summary>
     
    8284    event EventHandler CanBeCanceledChanged;
    8385    /// <summary>
    84     /// A cancelation is requested with a certain timeout (in ms) in which it should occur gracefully. If the timeout is surpassed, it should be forcibly canceled.
     86    /// A cancelation is requested.
    8587    /// </summary>
    86     event EventHandler<EventArgs<int>> CancelRequested;
     88    event EventHandler CancelRequested;
    8789  }
    8890}
  • trunk/sources/HeuristicLab.MainForm/3.3/Progress.cs

    r9893 r9894  
    2121
    2222using System;
    23 using HeuristicLab.Common;
    2423
    2524namespace HeuristicLab.MainForm {
     
    5049    public ProgressState ProgressState {
    5150      get { return progressState; }
    52       set {
     51      private set {
    5352        if (progressState != value) {
    5453          progressState = value;
     
    8382    }
    8483
    85     public void Cancel(int timeoutMs = 0) {
     84    public void Cancel() {
    8685      if (canBeCanceled)
    87         OnCancelRequested(timeoutMs);
     86        OnCancelRequested();
    8887    }
    8988
     
    126125      var handler = CanBeCanceledChanged;
    127126      if (handler != null) handler(this, EventArgs.Empty);
    128 
    129127    }
    130128
    131     public event EventHandler<EventArgs<int>> CancelRequested;
    132     private void OnCancelRequested(int timeoutMs) {
     129    public event EventHandler CancelRequested;
     130    private void OnCancelRequested() {
    133131      var handler = CancelRequested;
    134132      if (handler != null) throw new NotSupportedException("Cancel request was ignored.");
    135       else handler(this, new EventArgs<int>(timeoutMs));
     133      else handler(this, EventArgs.Empty);
    136134    }
    137135    #endregion
Note: See TracChangeset for help on using the changeset viewer.