Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/07/10 06:40:15 (14 years ago)
Author:
swagner
Message:

Implemented enabling and disabling of save buttons and menu items to prevent saving of running algorithms (#685)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveToolBarItem.cs

    r2796 r2958  
    2424using System.Windows.Forms;
    2525using HeuristicLab.Core;
     26using HeuristicLab.Core.Views;
    2627using HeuristicLab.MainForm;
    2728
     
    4647    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    4748      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
    48       ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType())));
     49      bool enable = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType())));
     50      ItemView itemView = MainFormManager.MainForm.ActiveView as ItemView;
     51      if ((enable) && (itemView != null)) enable = itemView.EnableFileOperations;
     52      ToolStripItem.Enabled = enable;
    4953    }
    5054
Note: See TracChangeset for help on using the changeset viewer.