Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/05/10 00:10:13 (14 years ago)
Author:
mkommend
Message:

implemented first version of RunConstraints (ticket #970)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs

    r3566 r3614  
    4242    }
    4343
     44    public RunCollection RunCollection {
     45      get { return Content as RunCollection; }
     46    }
     47
    4448    public ListView ItemsListView {
    4549      get { return itemsListView; }
     
    9498      while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
    9599      viewHost.Content = null;
     100      runCollectionConstraintCollectionView.Content = null;
     101      tabControl.TabPages.Remove(constraintPage);
    96102
    97103      if (Content != null) {
     104        if (RunCollection != null) {
     105          tabControl.TabPages.Add(constraintPage);
     106          runCollectionConstraintCollectionView.Content = RunCollection.Constraints;
     107          runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
     108        }
    98109        Caption += " (" + Content.GetType().Name + ")";
    99         foreach (IRun item in Content)
     110        foreach (IRun item in Content) {
    100111          AddListViewItem(CreateListViewItem(item));
     112          UpdateRun(item);
     113        }
    101114      }
    102115      SetEnabledStateOfControls();
     
    110123      if (Content == null) {
    111124        analyzeRunsToolStripDropDownButton.Enabled = false;
     125        runCollectionConstraintCollectionView.ReadOnly = true;
    112126        itemsListView.Enabled = false;
    113127        detailsGroupBox.Enabled = false;
     
    116130      } else {
    117131        analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
     132        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
    118133        itemsListView.Enabled = true;
    119134        detailsGroupBox.Enabled = true;
     
    262277          AddListViewItem(CreateListViewItem(item));
    263278        analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
     279        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
    264280      }
    265281    }
     
    276292        }
    277293        analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
     294        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
    278295      }
    279296    }
     
    293310          AddListViewItem(CreateListViewItem(item));
    294311        analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
     312        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
    295313      }
    296314    }
     
    318336    protected virtual void Run_Changed(object sender, EventArgs e) {
    319337      IRun run = (IRun)sender;
     338      UpdateRun(run);
     339    }
     340
     341    protected virtual void UpdateRun(IRun run) {
    320342      foreach (ListViewItem listViewItem in GetListViewItemsForItem(run)) {
    321343        if (run.Visible) {
Note: See TracChangeset for help on using the changeset viewer.