Changeset 17569
- Timestamp:
- 05/28/20 16:16:12 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
-
branches/2521_ProblemRefactoring/HeuristicLab.Core.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Core.Views merged: 17568
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Core.Views/3.3/ItemView.cs
r17226 r17569 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 -
branches/2521_ProblemRefactoring/HeuristicLab.Core.Views/3.3/NestingLevelErrorControl.cs
r17226 r17569 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.