Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9900


Ignore:
Timestamp:
08/22/13 16:29:58 (11 years ago)
Author:
mkommend
Message:

#1042: Renamed control parameter in MainForm while displaying a progress.

File:
1 edited

Legend:

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

    r9896 r9900  
    379379    /// Adds a <see cref="ProgressView"/> to the specified view.
    380380    /// </summary>
    381     public IProgress AddOperationProgressToView(Control view, string progressMessage) {
     381    public IProgress AddOperationProgressToView(Control control, string progressMessage) {
    382382      var progress = new Progress(progressMessage, ProgressState.Started);
    383       AddOperationProgressToView(view, progress);
     383      AddOperationProgressToView(control, progress);
    384384      return progress;
    385385    }
    386386
    387     public void AddOperationProgressToView(Control view, IProgress progress) {
    388       if (view == null) throw new ArgumentNullException("view", "The view must not be null.");
     387    public void AddOperationProgressToView(Control control, IProgress progress) {
     388      if (control == null) throw new ArgumentNullException("control", "The view must not be null.");
    389389      if (progress == null) throw new ArgumentNullException("progress", "The progress must not be null.");
    390390
    391      if (view == null) throw new ArgumentException("The passed view must be a control.", "view");
    392 
    393391      IProgress oldProgress;
    394       if (viewProgressLookup.TryGetValue(view, out oldProgress)) {
     392      if (viewProgressLookup.TryGetValue(control, out oldProgress)) {
    395393        foreach (var progressView in progressViews.Where(v => v.Content == oldProgress).ToList()) {
    396394          progressView.Dispose();
    397395          progressViews.Remove(progressView);
    398396        }
    399         viewProgressLookup.Remove(view);
    400       }
    401 
    402       progressViews.Add(new ProgressView(view, progress));
    403       viewProgressLookup[view] = progress;
     397        viewProgressLookup.Remove(control);
     398      }
     399
     400      progressViews.Add(new ProgressView(control, progress));
     401      viewProgressLookup[control] = progress;
    404402    }
    405403
     
    423421    /// Removes an existing <see cref="ProgressView"/> from the specified view.
    424422    /// </summary>
    425     public void RemoveOperationProgressFromView(Control view, bool finishProgress = true) {
     423    public void RemoveOperationProgressFromView(Control control, bool finishProgress = true) {
    426424      IProgress progress;
    427       if (!viewProgressLookup.TryGetValue(view, out progress))
    428         throw new ArgumentException("No progress is registered for the specified view.", "view");
     425      if (!viewProgressLookup.TryGetValue(control, out progress))
     426        throw new ArgumentException("No progress is registered for the specified control.", "control");
    429427
    430428      if (finishProgress) progress.Finish();
     
    433431        progressViews.Remove(progressView);
    434432      }
    435       viewProgressLookup.Remove(view);
     433      viewProgressLookup.Remove(control);
    436434    }
    437435    #endregion
Note: See TracChangeset for help on using the changeset viewer.