Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3796


Ignore:
Timestamp:
05/12/10 14:27:11 (14 years ago)
Author:
mkommend
Message:

corrected opening of views from the RunCollectionView (ticket #893)

Location:
trunk/sources
Files:
4 edited

Legend:

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

    r3794 r3796  
    222222
    223223    public IContentView ShowContent(IContent content) {
     224      if (content == null)
     225        throw new ArgumentNullException("Content cannot be null.");
    224226      Type viewType = MainFormManager.GetDefaultViewType(content.GetType());
    225227      if (viewType != null)
     
    228230    }
    229231
    230     internal IContentView ShowContent(IContent content, Type viewType) {
     232    public IContentView ShowContent(IContent content, Type viewType) {
     233      if (content == null)
     234        throw new ArgumentNullException("Content cannot be null.");
    231235      if (viewType == null)
    232         throw new ArgumentNullException("Could not create view of type null");
     236        throw new ArgumentNullException("ViewType cannot be null.");
    233237
    234238      IContentView view;
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs

    r3795 r3796  
    243243
    244244    private void viewsLabel_DoubleClick(object sender, EventArgs e) {
    245       IContentView view = MainFormManager.GetMainForm<MainForm>().ShowContent(this.Content, this.ViewType);
     245      IContentView view = MainFormManager.MainForm.ShowContent(this.Content, this.ViewType);
    246246      if (view != null) {
    247247        view.ReadOnly = this.ReadOnly;
  • trunk/sources/HeuristicLab.MainForm/3.3/Interfaces/IMainForm.cs

    r3557 r3796  
    4343
    4444    IContentView ShowContent(IContent content);
     45    IContentView ShowContent(IContent content, Type viewType);
    4546
    4647    Type UserInterfaceItemType { get; }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs

    r3775 r3796  
    260260    protected virtual void menuItem_Click(object sender, EventArgs e) {
    261261      ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;
    262       IContentView view = MainFormManager.CreateView((Type)menuItem.Tag);
     262      Type viewType = (Type)menuItem.Tag;
     263      IContentView view = MainFormManager.MainForm.ShowContent(Content, viewType);
    263264      if (view != null) {
    264265        view.Locked = Locked;
    265266        view.ReadOnly = ReadOnly;
    266         view.Show();
    267         view.Content = Content;
    268267      }
    269268    }
Note: See TracChangeset for help on using the changeset viewer.