Changeset 9900 for trunk/sources/HeuristicLab.MainForm.WindowsForms
- Timestamp:
- 08/22/13 16:29:58 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r9896 r9900 379 379 /// Adds a <see cref="ProgressView"/> to the specified view. 380 380 /// </summary> 381 public IProgress AddOperationProgressToView(Control view, string progressMessage) {381 public IProgress AddOperationProgressToView(Control control, string progressMessage) { 382 382 var progress = new Progress(progressMessage, ProgressState.Started); 383 AddOperationProgressToView( view, progress);383 AddOperationProgressToView(control, progress); 384 384 return progress; 385 385 } 386 386 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."); 389 389 if (progress == null) throw new ArgumentNullException("progress", "The progress must not be null."); 390 390 391 if (view == null) throw new ArgumentException("The passed view must be a control.", "view");392 393 391 IProgress oldProgress; 394 if (viewProgressLookup.TryGetValue( view, out oldProgress)) {392 if (viewProgressLookup.TryGetValue(control, out oldProgress)) { 395 393 foreach (var progressView in progressViews.Where(v => v.Content == oldProgress).ToList()) { 396 394 progressView.Dispose(); 397 395 progressViews.Remove(progressView); 398 396 } 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; 404 402 } 405 403 … … 423 421 /// Removes an existing <see cref="ProgressView"/> from the specified view. 424 422 /// </summary> 425 public void RemoveOperationProgressFromView(Control view, bool finishProgress = true) {423 public void RemoveOperationProgressFromView(Control control, bool finishProgress = true) { 426 424 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"); 429 427 430 428 if (finishProgress) progress.Finish(); … … 433 431 progressViews.Remove(progressView); 434 432 } 435 viewProgressLookup.Remove( view);433 viewProgressLookup.Remove(control); 436 434 } 437 435 #endregion
Note: See TracChangeset
for help on using the changeset viewer.