Changeset 17062 for stable/HeuristicLab.MainForm.WindowsForms/3.3/MainForms
- Timestamp:
- 07/04/19 14:45:47 (5 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r15584 r17062 61 61 set { 62 62 if (InvokeRequired) { 63 Action<string> action = delegate (string s) { this.Title = s; };63 Action<string> action = delegate (string s) { this.Title = s; }; 64 64 Invoke(action, value); 65 65 } else … … 72 72 set { 73 73 if (InvokeRequired) { 74 Action<Cursor> action = delegate (Cursor c) { this.Cursor = c; };74 Action<Cursor> action = delegate (Cursor c) { this.Cursor = c; }; 75 75 Invoke(action, value); 76 76 } else … … 95 95 if (this.activeView != value) { 96 96 if (InvokeRequired) { 97 Action<IView> action = delegate (IView activeView) { this.ActiveView = activeView; };97 Action<IView> action = delegate (IView activeView) { this.ActiveView = activeView; }; 98 98 Invoke(action, value); 99 99 } else { … … 230 230 } 231 231 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 { 233 233 if (content == null) throw new ArgumentNullException("Content cannot be null."); 234 234 if (!reuseExistingView) return ShowContent(content); … … 353 353 /// Adds a <see cref="ProgressView"/> to the <see cref="ContentView"/>s showing the specified content. 354 354 /// </summary> 355 public IProgress AddOperationProgressToContent(IContent content, string progressMessage, bool addToObjectGraphObjects = true) {355 internal void AddProgressToContent(IContent content, IProgress progress, bool addToObjectGraphObjects) { 356 356 if (InvokeRequired) { 357 I Progress 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; 359 359 } 360 360 if (contentProgressLookup.ContainsKey(content)) … … 371 371 contentViews = contentViews.Where(v => v.Content == content); 372 372 373 var progress = new Progress(progressMessage, ProgressState.Started);374 373 foreach (var contentView in contentViews) { 375 374 progressViews.Add(new ProgressView(contentView, progress)); … … 377 376 378 377 contentProgressLookup[content] = progress; 379 return progress;380 378 } 381 379 … … 383 381 /// Adds a <see cref="ProgressView"/> to the specified view. 384 382 /// </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) { 392 384 if (InvokeRequired) { 393 Invoke((Action<Control, IProgress>)Add OperationProgressToView, control, progress);385 Invoke((Action<Control, IProgress>)AddProgressToControl, control, progress); 394 386 return; 395 387 } … … 413 405 /// Removes an existing <see cref="ProgressView"/> from the <see cref="ContentView"/>s showing the specified content. 414 406 /// </summary> 415 public void RemoveOperationProgressFromContent(IContent content, bool finishProgress = true) {407 internal void RemoveProgressFromContent(IContent content, bool finishProgress) { 416 408 if (InvokeRequired) { 417 Invoke((Action<IContent, bool>)Remove OperationProgressFromContent, content, finishProgress);409 Invoke((Action<IContent, bool>)RemoveProgressFromContent, content, finishProgress); 418 410 return; 419 411 } … … 429 421 } 430 422 contentProgressLookup.Remove(content); 431 432 423 } 433 424 … … 435 426 /// Removes an existing <see cref="ProgressView"/> from the specified view. 436 427 /// </summary> 437 public void RemoveOperationProgressFromView(Control control, bool finishProgress = true) {428 internal void RemoveProgressFromControl(Control control, bool finishProgress) { 438 429 if (InvokeRequired) { 439 Invoke((Action<Control, bool>)Remove OperationProgressFromView, control, finishProgress);430 Invoke((Action<Control, bool>)RemoveProgressFromControl, control, finishProgress); 440 431 return; 441 432 } … … 560 551 try { 561 552 ((IActionUserInterfaceItem)item.Tag).Execute(); 562 } 563 catch (Exception ex) { 553 } catch (Exception ex) { 564 554 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex); 565 555 }
Note: See TracChangeset
for help on using the changeset viewer.