Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/29/10 01:44:57 (15 years ago)
Author:
swagner
Message:

Adapted HL 3.3 plugins according to changes in MainForm (#857)

Location:
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseAllMenuItem.cs

    r2708 r2713  
    2020      get { return 1700; }
    2121    }
    22     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    23       get { return ToolStripItemDisplayStyle.Text; }
    24     }
    2522
    2623    protected override void OnToolStripItemSet(EventArgs e) {
     
    2825    }
    2926    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    30       ToolStripItem.Enabled = MainFormManager.MainForm.Views.FirstOrDefault() != null;
     27      ToolStripItem.Enabled = MainFormManager.MainForm.Views.Any<IView>(v => v.IsShown);
    3128    }
    3229
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs

    r2708 r2713  
    2020      get { return 1600; }
    2121    }
    22     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    23       get { return ToolStripItemDisplayStyle.Text; }
    24     }
    2522
    2623    protected override void OnToolStripItemSet(EventArgs e) {
     
    2825    }
    2926    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    30       ToolStripItem.Enabled = MainFormManager.MainForm.Views.FirstOrDefault() != null;
     27      ToolStripItem.Enabled = MainFormManager.MainForm.ActiveView != null;
    3128    }
    3229
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/ExitMenuItem.cs

    r2708 r2713  
    2020      get { return 1999; }
    2121    }
    22     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    23       get { return ToolStripItemDisplayStyle.Text; }
    24     }
    2522    public override Keys ShortCutKeys {
    2623      get { return Keys.Control | Keys.X; }
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/NewMenuItem.cs

    r2708 r2713  
    1919      get { return 1100; }
    2020    }
    21     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    22       get { return ToolStripItemDisplayStyle.ImageAndText; }
    23     }
    2421    public override Image Image {
    2522      get { return Resources.NewIcon; }
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OpenMenuItem.cs

    r2708 r2713  
    1919      get { return 1200; }
    2020    }
    21     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    22       get { return ToolStripItemDisplayStyle.ImageAndText; }
    23     }
    2421    public override Image Image {
    2522      get { return Resources.OpenIcon; }
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OperatorsMenuItem.cs

    r2708 r2713  
    2424    public override int Position {
    2525      get { return 2100; }
    26     }
    27     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    28       get { return ToolStripItemDisplayStyle.Text; }
    2926    }
    3027
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs

    r2708 r2713  
    2222      get { return 1500; }
    2323    }
    24     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    25       get { return ToolStripItemDisplayStyle.ImageAndText; }
    26     }
    2724    public override Image Image {
    2825      get { return Resources.SaveAllIcon; }
     
    3431    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    3532      var views = from v in MainFormManager.MainForm.Views
    36                   where v is IObjectView
    37                   where CreatableAttribute.IsCreatable(((IObjectView)v).Object.GetType())
     33                  where v is IContentView
     34                  where CreatableAttribute.IsCreatable(((IContentView)v).Content.GetType())
    3835                  select v;
    3936      ToolStripItem.Enabled = views.FirstOrDefault() != null;
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs

    r2708 r2713  
    2222      get { return 1400; }
    2323    }
    24     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    25       get { return ToolStripItemDisplayStyle.ImageAndText; }
    26     }
    2724    public override Keys ShortCutKeys {
    2825      get { return Keys.Control | Keys.Shift | Keys.S; }
     
    3330    }
    3431    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    35       IObjectView activeView = MainFormManager.MainForm.ActiveView as IObjectView;
    36       ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Object.GetType())));
     32      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
     33      ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType())));
    3734    }
    3835
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs

    r2708 r2713  
    2222      get { return 1300; }
    2323    }
    24     public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    25       get { return ToolStripItemDisplayStyle.ImageAndText; }
    26     }
    2724    public override Image Image {
    2825      get { return Resources.SaveIcon; }
     
    3633    }
    3734    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    38       IObjectView activeView = MainFormManager.MainForm.ActiveView as IObjectView;
    39       ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Object.GetType())));
     35      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
     36      ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType())));
    4037    }
    4138
Note: See TracChangeset for help on using the changeset viewer.