Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/24/10 01:05:55 (15 years ago)
Author:
swagner
Message:

Implemented reviewers' comments (#893)

File:
1 edited

Legend:

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

    r3483 r3518  
    4444    }
    4545    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    46       ItemView activeView = MainFormManager.MainForm.ActiveView as ItemView;
    47       ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && !activeView.Locked;
     46      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
     47      ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is IItem) && !activeView.Locked;
    4848    }
    4949
    5050    public override void Execute() {
    51       ItemView activeView = MainFormManager.MainForm.ActiveView as ItemView;
    52       if ((activeView != null) && (activeView.Content != null) && !activeView.Locked) {
     51      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
     52      if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IItem) && !activeView.Locked) {
    5353        Clipboard<IItem> clipboard = ((OptimizerMainForm)MainFormManager.MainForm).Clipboard;
    54         clipboard.AddItem((IItem)activeView.Content.Clone());
     54        IItem content = (IItem)activeView.Content;
     55        clipboard.AddItem((IItem)content.Clone());
    5556      }
    5657    }
Note: See TracChangeset for help on using the changeset viewer.