Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/27/14 09:35:43 (10 years ago)
Author:
jkarder
Message:

#2116: reverted to r10041

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs

    r10103 r11591  
    237237    #region ListView Events
    238238    private void itemsListView_SelectedIndexChanged(object sender, EventArgs e) {
    239       removeButton.Enabled = Content != null && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0;
     239      removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && (Content != null) && !Content.IsReadOnly && !ReadOnly;
    240240      // for performance reason (multiple selection fires this handler for every selected item)
    241241      if (itemsListView.SelectedIndices.Count <= 1)
    242242        AdjustListViewColumnSizes();
    243       if (itemsListView.SelectedItems.Count == 1) {
    244         var item = (IRun)itemsListView.SelectedItems[0].Tag;
    245         var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    246         var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true);
    247         if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) {
    248           outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    249           outermostViewHost.ActiveView.Locked = Locked;
     243      if (showDetailsCheckBox.Checked) {
     244        if (itemsListView.SelectedItems.Count == 1) {
     245          IRun item = (IRun)itemsListView.SelectedItems[0].Tag;
     246          detailsGroupBox.Enabled = true;
     247          viewHost.Content = item;
    250248        } else {
    251           if (showDetailsCheckBox.Checked) {
    252             detailsGroupBox.Enabled = true;
    253             viewHost.Content = item;
    254           } else {
    255             viewHost.Content = null;
    256             detailsGroupBox.Enabled = false;
    257           }
     249          viewHost.Content = null;
     250          detailsGroupBox.Enabled = false;
    258251        }
    259252      }
     
    273266    private void itemsListView_DoubleClick(object sender, EventArgs e) {
    274267      if (itemsListView.SelectedItems.Count == 1) {
    275         var item = (IRun)itemsListView.SelectedItems[0].Tag;
    276         var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    277         var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this);
    278         if (outermostViewHost != null) {
    279           outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    280           outermostViewHost.ActiveView.Locked = Locked;
     268        IRun item = itemsListView.SelectedItems[0].Tag as IRun;
     269        if (item != null) {
     270          IContentView view = MainFormManager.MainForm.ShowContent(item);
     271          if (view != null) {
     272            view.ReadOnly = ReadOnly;
     273            view.Locked = Locked;
     274          }
    281275        }
    282276      }
     
    391385      try {
    392386        RunCollection.Modify();
    393       } finally {
     387      }
     388      finally {
    394389        ReadOnly = false;
    395390      }
Note: See TracChangeset for help on using the changeset viewer.