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.Core.Views/3.3/ItemListView.cs

    r10103 r11591  
    146146        try {
    147147          return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    148         } catch (Exception ex) {
     148        }
     149        catch (Exception ex) {
    149150          ErrorHandling.ShowErrorDialog(this, ex);
    150151        }
     
    242243                             (Content != null) && !Content.IsReadOnly && !ReadOnly;
    243244      AdjustListViewColumnSizes();
    244       if (itemsListView.SelectedItems.Count == 1) {
    245         var item = (T)itemsListView.SelectedItems[0].Tag;
    246         var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    247         var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true);
    248         if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) {
    249           outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    250           outermostViewHost.ActiveView.Locked = Locked;
     245
     246      if (showDetailsCheckBox.Checked) {
     247        if (itemsListView.SelectedItems.Count == 1) {
     248          T item = (T)itemsListView.SelectedItems[0].Tag;
     249          detailsGroupBox.Enabled = true;
     250          viewHost.Content = item;
    251251        } else {
    252           if (showDetailsCheckBox.Checked) {
    253             detailsGroupBox.Enabled = true;
    254             viewHost.Content = item;
    255           } else {
    256             viewHost.Content = null;
    257             detailsGroupBox.Enabled = false;
    258           }
     252          viewHost.Content = null;
     253          detailsGroupBox.Enabled = false;
    259254        }
    260255      }
     
    272267    protected virtual void itemsListView_DoubleClick(object sender, EventArgs e) {
    273268      if (itemsListView.SelectedItems.Count == 1) {
    274         var item = (T)itemsListView.SelectedItems[0].Tag;
    275         var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    276         var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this);
    277         if (outermostViewHost != null) {
    278           outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    279           outermostViewHost.ActiveView.Locked = Locked;
     269        T item = itemsListView.SelectedItems[0].Tag as T;
     270        if (item != null) {
     271          IContentView view = MainFormManager.MainForm.ShowContent(item);
     272          if (view != null) {
     273            view.ReadOnly = ReadOnly;
     274            view.Locked = Locked;
     275          }
    280276        }
    281277      }
Note: See TracChangeset for help on using the changeset viewer.