Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17569 for branches


Ignore:
Timestamp:
05/28/20 16:16:12 (4 years ago)
Author:
mkommend
Message:

#2521: Merged trunk changes into branch.

Location:
branches/2521_ProblemRefactoring
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring

  • branches/2521_ProblemRefactoring/HeuristicLab.Core.Views

  • branches/2521_ProblemRefactoring/HeuristicLab.Core.Views/3.3/ItemView.cs

    r17226 r17569  
    4545
    4646      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();
    4948        errorControl.Dock = DockStyle.Fill;
    5049
  • branches/2521_ProblemRefactoring/HeuristicLab.Core.Views/3.3/NestingLevelErrorControl.cs

    r17226 r17569  
    2020#endregion
    2121
    22 using System;
    2322using System.Windows.Forms;
    24 using HeuristicLab.Common;
    2523using HeuristicLab.MainForm;
    2624
    2725namespace HeuristicLab.Core.Views {
    2826  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() {
    3428      InitializeComponent();
    35       Content = content;
    36       ViewType = viewType;
    3729    }
    3830
     31    private IContentView SurroundingView => (IContentView)Parent;
     32
    3933    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;
    4340    }
    4441  }
Note: See TracChangeset for help on using the changeset viewer.