- Timestamp:
- 10/28/13 17:50:31 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r10042 r10089 237 237 #region ListView Events 238 238 private void itemsListView_SelectedIndexChanged(object sender, EventArgs e) { 239 removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && (Content != null) && !Content.IsReadOnly && !ReadOnly;239 removeButton.Enabled = Content != null && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0; 240 240 // for performance reason (multiple selection fires this handler for every selected item) 241 241 if (itemsListView.SelectedIndices.Count <= 1) 242 242 AdjustListViewColumnSizes(); 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; 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.GetOutermostViewOfType<ViewHost>(this); 247 if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) { 248 var oldCrumbs = outermostViewHost.Breadcrumbs; 249 var newCrumbs = BuildBreadcrumbTrail(); 250 mainForm.ShowContentInSpecificViewHost(item, outermostViewHost); 251 outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 252 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 253 outermostViewHost.ActiveView.Locked = Locked; 248 254 } else { 249 viewHost.Content = null; 250 detailsGroupBox.Enabled = false; 255 if (showDetailsCheckBox.Checked) { 256 detailsGroupBox.Enabled = true; 257 viewHost.Content = item; 258 } else { 259 viewHost.Content = null; 260 detailsGroupBox.Enabled = false; 261 } 251 262 } 252 263 } … … 266 277 private void itemsListView_DoubleClick(object sender, EventArgs e) { 267 278 if (itemsListView.SelectedItems.Count == 1) { 268 var item = itemsListView.SelectedItems[0].Tag as IRun; 269 if (item != null) { 270 ViewHost outmostViewHost = null; 271 for (var control = Parent; control != null; control = control.Parent) { 272 var vh = control as ViewHost; 273 if (vh != null) outmostViewHost = vh; 274 } 275 if (outmostViewHost != null) { 276 var oldCrumbs = outmostViewHost.Breadcrumbs; 277 var newCrumbs = BuildBreadcrumbTrail(); 278 outmostViewHost.Content = null; 279 var viewType = MainFormManager.GetDefaultViewType(item.GetType()); 280 outmostViewHost.ViewType = viewType; 281 outmostViewHost.Content = item; 282 outmostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 283 outmostViewHost.ActiveView.ReadOnly = ReadOnly; 284 outmostViewHost.ActiveView.Locked = Locked; 285 } 286 } 279 var item = (IRun)itemsListView.SelectedItems[0].Tag; 280 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 281 var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this); 282 var oldCrumbs = outermostViewHost.Breadcrumbs; 283 var newCrumbs = BuildBreadcrumbTrail(); 284 mainForm.ShowContentInSpecificViewHost(item, outermostViewHost); 285 outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 286 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 287 outermostViewHost.ActiveView.Locked = Locked; 287 288 } 288 289 }
Note: See TracChangeset
for help on using the changeset viewer.