Changeset 3709


Ignore:
Timestamp:
05/07/10 18:12:52 (12 years ago)
Author:
mkommend
Message:

corrected collection views and ViewHost (ticket #972)

Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs

    r3694 r3709  
    204204        T item = itemsListView.SelectedItems[0].Tag as T;
    205205        detailsGroupBox.Enabled = true;
    206         viewHost.ViewType = null;
    207206        viewHost.Content = item;
    208207      } else {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r3694 r3709  
    167167        T item = (T)itemsListView.SelectedItems[0].Tag;
    168168        detailsGroupBox.Enabled = true;
    169         viewHost.ViewType = null;
    170169        viewHost.Content = item;
    171170      } else {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r3694 r3709  
    199199        T item = (T)itemsListView.SelectedItems[0].Tag;
    200200        detailsGroupBox.Enabled = true;
    201         viewHost.ViewType = null;
    202201        viewHost.Content = item;
    203202      } else {
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs

    r3670 r3709  
    8383      }
    8484    }
    85     public new IContent Content {
    86       get { return base.Content; }
    87       set {
    88         if (value == null || this.Content == null || value.GetType() != this.Content.GetType())
    89           cachedViews.Clear();
    90 
    91         base.Content = value;
    92       }
    93     }
    9485
    9586    public new bool Enabled {
     
    118109
    119110        if (!ViewCanShowContent(viewType, Content)) {
     111          cachedViews.Clear();
    120112          ViewType = MainFormManager.GetDefaultViewType(Content.GetType());
    121113          if ((viewType == null) && (viewContextMenuStrip.Items.Count > 0))  // create first available view if default view is not available
     
    129121        viewsLabel.Visible = false;
    130122        viewPanel.Visible = false;
    131         if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose();
    132         viewPanel.Controls.Clear();
    133         cachedViews.Clear();
    134123      }
    135124    }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs

    r3694 r3709  
    7575      } else {
    7676        repetitionsNumericUpDown.Value = Content.Repetitions;
    77         algorithmViewHost.ViewType = null;
    7877        algorithmViewHost.Content = Content.Algorithm;
    7978        runsView.Content = Content.Runs;
     
    127126        Invoke(new EventHandler(Content_AlgorithmChanged), sender, e);
    128127      else {
    129         algorithmViewHost.ViewType = null;
    130128        algorithmViewHost.Content = Content.Algorithm;
    131129      }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs

    r3694 r3709  
    9898      while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
    9999      viewHost.Content = null;
    100       runCollectionConstraintCollectionView.Content = null;
    101       tabControl.TabPages.Remove(constraintPage);
    102100
    103101      if (Content != null) {
    104102        if (RunCollection != null) {
    105           tabControl.TabPages.Add(constraintPage);
     103          if (!tabControl.TabPages.Contains(constraintPage))
     104            tabControl.TabPages.Add(constraintPage);
    106105          runCollectionConstraintCollectionView.Content = RunCollection.Constraints;
    107106          runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
     
    112111          UpdateRun(item);
    113112        }
     113      } else {
     114        runCollectionConstraintCollectionView.Content = null;
     115        if (tabControl.TabPages.Contains(constraintPage))
     116          tabControl.TabPages.Remove(constraintPage);
    114117      }
    115118      SetEnabledStateOfControls();
     
    183186        IRun item = (IRun)itemsListView.SelectedItems[0].Tag;
    184187        detailsGroupBox.Enabled = true;
    185         viewHost.ViewType = null;
    186188        viewHost.Content = item;
    187189      } else {
Note: See TracChangeset for help on using the changeset viewer.