Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/26/12 09:51:13 (12 years ago)
Author:
jkarder
Message:

#1331: merged r8086:8330 from trunk

Location:
branches/ScatterSearch (trunk integration)
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)

  • branches/ScatterSearch (trunk integration)/HeuristicLab.MainForm/3.3/Interfaces/IProgress.cs

    r7582 r8331  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324
    2425namespace HeuristicLab.MainForm {
    25   public interface IProgress {
    26     string Status { get; set; }
    27     double ProgressValue { get; set; }
     26  public enum ProgressState { Started = 1, Canceled = 2, Finished = 3 };
    2827
    29     void Finish();
     28  public interface IProgress : IContent {
     29    /// <summary>
     30    /// Gets the currently associated status text with the progress.
     31    /// </summary>
     32    string Status { get; }
     33    /// <summary>
     34    /// Gets the currently associated progress value in the range (0;1].
     35    ///  Values outside this range are permitted and need to be handled in some feasible manner.
     36    /// </summary>
     37    double ProgressValue { get; }
     38    /// <summary>
     39    /// Gets the current state of the progress. Every progress starts in state
     40    /// Started and then becomes either Canceled or Finished.
     41    /// If it is reused it may be Started again.
     42    /// </summary>
     43    ProgressState ProgressState { get; }
     44    /// <summary>
     45    /// Returns whether the operation can be canceled or not.
     46    /// This can change during the course of the progress.
     47    /// </summary>
     48    bool CanBeCanceled { get; }
    3049
    31     event EventHandler Finished;
     50    /// <summary>
     51    /// Requests the operation behind the process to cancel.
     52    /// Check the !ProgressState property when the cancellation succeeded.
     53    /// The corresponding event will also notify of a success.
     54    /// </summary>
     55    /// <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);
     58
     59    /// <summary>
     60    /// The status text changed.
     61    /// </summary>
    3262    event EventHandler StatusChanged;
     63    /// <summary>
     64    /// The value of the progress changed. This is the (0;1] progress value from starting to finish. Values outside this range are permitted and need to be handled in some feasible manner.
     65    /// </summary>
    3366    event EventHandler ProgressValueChanged;
     67    /// <summary>
     68    /// The state of the progress changed. The handler is supposed to query the ProgressState property.
     69    /// </summary>
     70    event EventHandler ProgressStateChanged;
     71    /// <summary>
     72    /// The progress' ability to cancel changed.
     73    /// </summary>
     74    event EventHandler CanBeCanceledChanged;
     75    /// <summary>
     76    /// 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.
     77    /// </summary>
     78    event EventHandler<EventArgs<int>> CancelRequested;
    3479  }
    3580}
Note: See TracChangeset for help on using the changeset viewer.