Changeset 10042 for branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
- Timestamp:
- 10/15/13 16:11:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r9613 r10042 266 266 private void itemsListView_DoubleClick(object sender, EventArgs e) { 267 267 if (itemsListView.SelectedItems.Count == 1) { 268 IRunitem = itemsListView.SelectedItems[0].Tag as IRun;268 var item = itemsListView.SelectedItems[0].Tag as IRun; 269 269 if (item != null) { 270 IContentView view = MainFormManager.MainForm.ShowContent(item); 271 if (view != null) { 272 view.ReadOnly = ReadOnly; 273 view.Locked = Locked; 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; 274 285 } 275 286 } … … 385 396 try { 386 397 RunCollection.Modify(); 387 } 388 finally { 398 } finally { 389 399 ReadOnly = false; 390 400 } … … 500 510 } 501 511 } 512 private IEnumerable<IContent> BuildBreadcrumbTrail() { 513 var l = new LinkedList<IContent>(); 514 for (var control = (Control)this; control != null; control = control.Parent) { 515 var vh = control as ViewHost; 516 if (vh != null && vh.Content != null) 517 l.AddFirst(vh.Content); 518 } 519 return l; 520 } 502 521 #endregion 503 522 }
Note: See TracChangeset
for help on using the changeset viewer.