Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/10 02:08:29 (15 years ago)
Author:
mkommend
Message:

enhanced caching of views in ViewHost and adapted MainFormManager to use IContentView (ticket #972)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewContextMenuStrip.cs

    r2992 r3389  
    1212      InitializeComponent();
    1313      this.menuItems = new Dictionary<Type, ToolStripMenuItem>();
     14      this.ignoredViewTypes = new List<Type>();
    1415    }
    1516
     
    3031    }
    3132
     33    private List<Type> ignoredViewTypes;
     34    public IEnumerable<Type> IgnoredViewTypes {
     35      get { return this.ignoredViewTypes; }
     36      set { this.ignoredViewTypes = new List<Type>(value); RefreshMenuItems(); }
     37    }
     38
    3239    private Dictionary<Type, ToolStripMenuItem> menuItems;
    3340    public IEnumerable<KeyValuePair<Type, ToolStripMenuItem>> MenuItems {
     
    4249        ToolStripMenuItem menuItem;
    4350        IEnumerable<Type> types = MainFormManager.GetViewTypes(item.GetType(),true);
    44         foreach (Type t in types) {
     51        foreach (Type t in types.Except(IgnoredViewTypes)) {
    4552          menuItem = new ToolStripMenuItem();
    4653          menuItem.Tag = t;
Note: See TracChangeset for help on using the changeset viewer.