Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/04/19 14:45:47 (5 years ago)
Author:
mkommend
Message:

#2845: Merged 16430 into stable.

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs

    r15584 r17062  
    6161      set {
    6262        if (InvokeRequired) {
    63           Action<string> action = delegate(string s) { this.Title = s; };
     63          Action<string> action = delegate (string s) { this.Title = s; };
    6464          Invoke(action, value);
    6565        } else
     
    7272      set {
    7373        if (InvokeRequired) {
    74           Action<Cursor> action = delegate(Cursor c) { this.Cursor = c; };
     74          Action<Cursor> action = delegate (Cursor c) { this.Cursor = c; };
    7575          Invoke(action, value);
    7676        } else
     
    9595        if (this.activeView != value) {
    9696          if (InvokeRequired) {
    97             Action<IView> action = delegate(IView activeView) { this.ActiveView = activeView; };
     97            Action<IView> action = delegate (IView activeView) { this.ActiveView = activeView; };
    9898            Invoke(action, value);
    9999          } else {
     
    230230    }
    231231
    232     public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class,IContent {
     232    public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class, IContent {
    233233      if (content == null) throw new ArgumentNullException("Content cannot be null.");
    234234      if (!reuseExistingView) return ShowContent(content);
     
    353353    /// Adds a <see cref="ProgressView"/> to the <see cref="ContentView"/>s showing the specified content.
    354354    /// </summary>
    355     public IProgress AddOperationProgressToContent(IContent content, string progressMessage, bool addToObjectGraphObjects = true) {
     355    internal void AddProgressToContent(IContent content, IProgress progress, bool addToObjectGraphObjects) {
    356356      if (InvokeRequired) {
    357         IProgress result = (IProgress)Invoke((Func<IContent, string, bool, IProgress>)AddOperationProgressToContent, content, progressMessage, addToObjectGraphObjects);
    358         return result;
     357        Invoke((Action<IContent, IProgress, bool>)AddProgressToContent, content, progress, addToObjectGraphObjects);
     358        return;
    359359      }
    360360      if (contentProgressLookup.ContainsKey(content))
     
    371371        contentViews = contentViews.Where(v => v.Content == content);
    372372
    373       var progress = new Progress(progressMessage, ProgressState.Started);
    374373      foreach (var contentView in contentViews) {
    375374        progressViews.Add(new ProgressView(contentView, progress));
     
    377376
    378377      contentProgressLookup[content] = progress;
    379       return progress;
    380378    }
    381379
     
    383381    /// Adds a <see cref="ProgressView"/> to the specified view.
    384382    /// </summary>
    385     public IProgress AddOperationProgressToView(Control control, string progressMessage) {
    386       var progress = new Progress(progressMessage, ProgressState.Started);
    387       AddOperationProgressToView(control, progress);
    388       return progress;
    389     }
    390 
    391     public void AddOperationProgressToView(Control control, IProgress progress) {
     383    internal void AddProgressToControl(Control control, IProgress progress) {
    392384      if (InvokeRequired) {
    393         Invoke((Action<Control, IProgress>)AddOperationProgressToView, control, progress);
     385        Invoke((Action<Control, IProgress>)AddProgressToControl, control, progress);
    394386        return;
    395387      }
     
    413405    /// Removes an existing <see cref="ProgressView"/> from the <see cref="ContentView"/>s showing the specified content.
    414406    /// </summary>
    415     public void RemoveOperationProgressFromContent(IContent content, bool finishProgress = true) {
     407    internal void RemoveProgressFromContent(IContent content, bool finishProgress) {
    416408      if (InvokeRequired) {
    417         Invoke((Action<IContent, bool>)RemoveOperationProgressFromContent, content, finishProgress);
     409        Invoke((Action<IContent, bool>)RemoveProgressFromContent, content, finishProgress);
    418410        return;
    419411      }
     
    429421      }
    430422      contentProgressLookup.Remove(content);
    431 
    432423    }
    433424
     
    435426    /// Removes an existing <see cref="ProgressView"/> from the specified view.
    436427    /// </summary>
    437     public void RemoveOperationProgressFromView(Control control, bool finishProgress = true) {
     428    internal void RemoveProgressFromControl(Control control, bool finishProgress) {
    438429      if (InvokeRequired) {
    439         Invoke((Action<Control, bool>)RemoveOperationProgressFromView, control, finishProgress);
     430        Invoke((Action<Control, bool>)RemoveProgressFromControl, control, finishProgress);
    440431        return;
    441432      }
     
    560551      try {
    561552        ((IActionUserInterfaceItem)item.Tag).Execute();
    562       }
    563       catch (Exception ex) {
     553      } catch (Exception ex) {
    564554        ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex);
    565555      }
Note: See TracChangeset for help on using the changeset viewer.