Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/13/15 13:15:03 (9 years ago)
Author:
ascheibe
Message:

#2158 merged r11555,r11557,r11592,r11736 into stable

Location:
stable
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Core.Views/3.3/NestingLevelErrorControl.cs

    r11555 r11748  
    2727namespace HeuristicLab.Core.Views {
    2828  public partial class NestingLevelErrorControl : UserControl {
    29     public Func<IContent> Content { get; set; }
     29    private Func<IContent> Content { get; set; }
     30    private Type ViewType { get; set; }
    3031
    31     public NestingLevelErrorControl() {
     32    public NestingLevelErrorControl(Func<IContent> content, Type viewType)
     33      : base() {
    3234      InitializeComponent();
     35      Content = content;
     36      ViewType = viewType;
    3337    }
    3438
    3539    private void showButton_Click(object sender, System.EventArgs e) {
    36       if (Content != null) {
    37         if (MainFormManager.MainForm.ShowContent(Content()) == null) {
    38           using (TypeSelectorDialog dialog = new TypeSelectorDialog()) {
    39             dialog.Caption = "Unable to find view for content. Please choose a appropriate view.";
    40             dialog.TypeSelector.Configure(typeof(IContentView), false, false);
    41 
    42             if (dialog.ShowDialog(this) == DialogResult.OK) {
    43               MainFormManager.MainForm.ShowContent(Content(), dialog.TypeSelector.SelectedType);
    44             }
    45           }
    46         }
     40      if (Content != null && ViewType != null) {
     41        MainFormManager.MainForm.ShowContent(Content(), ViewType);
    4742      }
    4843    }
Note: See TracChangeset for help on using the changeset viewer.