Free cookie consent management tool by TermsFeed Policy Generator

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

#1042 changed MainForm progress handling to work with controls instead of views

File:
1 edited

Legend:

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

    r9894 r9896  
    347347    #region progress views
    348348    private readonly Dictionary<IContent, IProgress> contentProgressLookup = new Dictionary<IContent, IProgress>();
    349     private readonly Dictionary<IView, IProgress> viewProgressLookup = new Dictionary<IView, IProgress>();
     349    private readonly Dictionary<Control, IProgress> viewProgressLookup = new Dictionary<Control, IProgress>();
    350350    private readonly List<ProgressView> progressViews = new List<ProgressView>();
    351351
     
    369369      var progress = new Progress(progressMessage, ProgressState.Started);
    370370      foreach (var contentView in contentViews) {
    371         progressViews.Add(new ProgressView((Control)contentView, progress));
     371        progressViews.Add(new ProgressView(contentView, progress));
    372372      }
    373373
     
    379379    /// Adds a <see cref="ProgressView"/> to the specified view.
    380380    /// </summary>
    381     public IProgress AddOperationProgressToView(IView view, string progressMessage) {
     381    public IProgress AddOperationProgressToView(Control view, string progressMessage) {
    382382      var progress = new Progress(progressMessage, ProgressState.Started);
    383383      AddOperationProgressToView(view, progress);
     
    385385    }
    386386
    387     public void AddOperationProgressToView(IView view, IProgress progress) {
     387    public void AddOperationProgressToView(Control view, IProgress progress) {
    388388      if (view == null) throw new ArgumentNullException("view", "The view must not be null.");
    389389      if (progress == null) throw new ArgumentNullException("progress", "The progress must not be null.");
    390390
    391       var control = view as Control;
    392       if (control == null) throw new ArgumentException("The passed view must be a control.", "view");
     391     if (view == null) throw new ArgumentException("The passed view must be a control.", "view");
    393392
    394393      IProgress oldProgress;
     
    401400      }
    402401
    403       progressViews.Add(new ProgressView(control, progress));
     402      progressViews.Add(new ProgressView(view, progress));
    404403      viewProgressLookup[view] = progress;
    405404    }
     
    424423    /// Removes an existing <see cref="ProgressView"/> from the specified view.
    425424    /// </summary>
    426     public void RemoveOperationProgressFromView(IView view, bool finishProgress = true) {
     425    public void RemoveOperationProgressFromView(Control view, bool finishProgress = true) {
    427426      IProgress progress;
    428427      if (!viewProgressLookup.TryGetValue(view, out progress))
Note: See TracChangeset for help on using the changeset viewer.