- Timestamp:
- 11/27/14 09:35:43 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r10103 r11591 140 140 try { 141 141 return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 142 } catch (Exception ex) { 142 } 143 catch (Exception ex) { 143 144 ErrorHandling.ShowErrorDialog(this, ex); 144 145 } … … 219 220 #region ListView Events 220 221 protected virtual void itemsListView_SelectedIndexChanged(object sender, EventArgs e) { 221 removeButton.Enabled = Content != null&& !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0;222 removeButton.Enabled = (Content != null) && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0; 222 223 AdjustListViewColumnSizes(); 223 if (itemsListView.SelectedItems.Count == 1) { 224 var item = (T)itemsListView.SelectedItems[0].Tag; 225 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 226 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true); 227 if (outermostViewHost == null || !outermostViewHost.HotlinkingEnabled) { 228 if (showDetailsCheckBox.Checked) { 229 detailsGroupBox.Enabled = true; 230 viewHost.Content = item; 231 } else { 232 viewHost.Content = null; 233 detailsGroupBox.Enabled = false; 234 } 224 if (showDetailsCheckBox.Checked) { 225 if (itemsListView.SelectedItems.Count == 1) { 226 T item = (T)itemsListView.SelectedItems[0].Tag; 227 detailsGroupBox.Enabled = true; 228 viewHost.Content = item; 229 } else { 230 viewHost.Content = null; 231 detailsGroupBox.Enabled = false; 235 232 } 236 233 } … … 249 246 protected virtual void itemsListView_DoubleClick(object sender, EventArgs e) { 250 247 if (itemsListView.SelectedItems.Count == 1) { 251 var item = (T)itemsListView.SelectedItems[0].Tag; 252 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 253 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this); 254 if (outermostViewHost != null) { 255 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 256 outermostViewHost.ActiveView.Locked = Locked; 248 T item = itemsListView.SelectedItems[0].Tag as T; 249 if (item != null) { 250 IContentView view = MainFormManager.MainForm.ShowContent(item); 251 if (view != null) { 252 view.ReadOnly = ReadOnly; 253 view.Locked = Locked; 254 } 257 255 } 258 256 }
Note: See TracChangeset
for help on using the changeset viewer.