Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9905 for trunk/sources


Ignore:
Timestamp:
08/23/13 11:21:02 (11 years ago)
Author:
mkommend
Message:

#1042: Added invoke required checks to the progress view display.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs

    r9900 r9905  
    354354    /// </summary>
    355355    public IProgress AddOperationProgressToContent(IContent content, string progressMessage, bool addToObjectGraphObjects = true) {
     356      if (InvokeRequired) {
     357        IProgress result = (IProgress)Invoke((Func<IContent, string, bool, IProgress>)AddOperationProgressToContent, content, progressMessage, addToObjectGraphObjects);
     358        return result;
     359      }
    356360      if (contentProgressLookup.ContainsKey(content))
    357361        throw new ArgumentException("A progress is already registered for the specified content.", "content");
     
    386390
    387391    public void AddOperationProgressToView(Control control, IProgress progress) {
     392      if (InvokeRequired) {
     393        Invoke((Action<Control, IProgress>)AddOperationProgressToView, control, progress);
     394        return;
     395      }
    388396      if (control == null) throw new ArgumentNullException("control", "The view must not be null.");
    389397      if (progress == null) throw new ArgumentNullException("progress", "The progress must not be null.");
     
    406414    /// </summary>
    407415    public void RemoveOperationProgressFromContent(IContent content, bool finishProgress = true) {
     416      if (InvokeRequired) {
     417        Invoke((Action<IContent, bool>)RemoveOperationProgressFromContent, content, finishProgress);
     418        return;
     419      }
     420
    408421      IProgress progress;
    409422      if (!contentProgressLookup.TryGetValue(content, out progress))
     
    416429      }
    417430      contentProgressLookup.Remove(content);
     431
    418432    }
    419433
Note: See TracChangeset for help on using the changeset viewer.