Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/13 12:05:19 (11 years ago)
Author:
ascheibe
Message:

#1886 added a library that calculates convex hulls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/PermutationSolutionDictionaryView.cs

    r9728 r9730  
    2020#endregion
    2121
     22using System;
     23using System.Linq;
    2224using System.Windows.Forms;
    2325using HeuristicLab.Core.Views;
    2426using HeuristicLab.MainForm;
     27using HeuristicLab.MainForm.WindowsForms;
    2528
    2629namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views {
     
    4851        completeSizeTextBox.Text = Content.NumberOfCompleteSolutions().ToString();
    4952      }
    50     }                                                                             
     53    }
     54
     55    protected override void OnInitialized(EventArgs e) {
     56      base.OnInitialized(e);
     57      var viewTypes = MainFormManager.GetViewTypes(typeof(PermutationSolutionDictionary<PermutationWrapper, PermutationInformation>), true);
     58      foreach (Type viewType in viewTypes.OrderBy(x => ViewAttribute.GetViewName(x))) {
     59        if ((viewType != typeof(PermutationSolutionDictionaryView)) && (viewType != typeof(ViewHost))) {
     60          ToolStripMenuItem menuItem = new ToolStripMenuItem();
     61          menuItem.Text = ViewAttribute.GetViewName(viewType);
     62          menuItem.Tag = viewType;
     63          menuItem.Click += new EventHandler(menuItem_Click);
     64          analyzeToolStripButton.DropDownItems.Add(menuItem);
     65        }
     66      }
     67    }
     68
     69    private void menuItem_Click(object sender, EventArgs e) {
     70      ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;
     71      Type viewType = (Type)menuItem.Tag;
     72      IContentView view = MainFormManager.MainForm.ShowContent(Content, viewType);
     73      if (view != null) {
     74        view.Locked = Locked;
     75        view.ReadOnly = ReadOnly;
     76      }
     77    }
    5178  }
    5279}
Note: See TracChangeset for help on using the changeset viewer.