Changeset 17568
- Timestamp:
- 05/28/20 15:56:23 (5 years ago)
- Location:
- trunk/HeuristicLab.Core.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Core.Views/3.3/ItemView.cs
r17180 r17568 45 45 46 46 if (CountParentControls() > Properties.Settings.Default.MaximumNestedControls) { 47 //capture content, needed because it is set at a later time 48 NestingLevelErrorControl errorControl = new NestingLevelErrorControl(() => Content, this.GetType()); 47 var errorControl = new NestingLevelErrorControl(); 49 48 errorControl.Dock = DockStyle.Fill; 50 49 -
trunk/HeuristicLab.Core.Views/3.3/NestingLevelErrorControl.cs
r17180 r17568 20 20 #endregion 21 21 22 using System;23 22 using System.Windows.Forms; 24 using HeuristicLab.Common;25 23 using HeuristicLab.MainForm; 26 24 27 25 namespace HeuristicLab.Core.Views { 28 26 public partial class NestingLevelErrorControl : UserControl { 29 private Func<IContent> Content { get; set; } 30 private Type ViewType { get; set; } 31 32 public NestingLevelErrorControl(Func<IContent> content, Type viewType) 33 : base() { 27 public NestingLevelErrorControl() : base() { 34 28 InitializeComponent(); 35 Content = content;36 ViewType = viewType;37 29 } 38 30 31 private IContentView SurroundingView => (IContentView)Parent; 32 39 33 private void showButton_Click(object sender, System.EventArgs e) { 40 if (Content != null && ViewType != null) { 41 MainFormManager.MainForm.ShowContent(Content(), ViewType); 42 } 34 if (SurroundingView == null) return; 35 if (SurroundingView.Content == null) return; 36 37 var view = MainFormManager.MainForm.ShowContent(SurroundingView.Content, SurroundingView.GetType()); 38 view.ReadOnly = SurroundingView.ReadOnly; 39 view.Locked = SurroundingView.Locked; 43 40 } 44 41 }
Note: See TracChangeset
for help on using the changeset viewer.