- Timestamp:
- 10/29/13 13:47:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunView.cs
r10089 r10093 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 23 using System.Windows.Forms; 26 24 using HeuristicLab.Common; … … 133 131 var item = (IItem)listView.SelectedItems[0].Tag; 134 132 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 135 var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this); 136 if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) { 137 var oldCrumbs = outermostViewHost.Breadcrumbs; 138 var newCrumbs = BuildBreadcrumbTrail(); 139 mainForm.ShowContentInSpecificViewHost(item, outermostViewHost); 140 outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 133 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true); 134 if (outermostViewHost.HotlinkingEnabled) { 141 135 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 142 136 outermostViewHost.ActiveView.Locked = Locked; … … 156 150 var item = (IItem)listView.SelectedItems[0].Tag; 157 151 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 158 var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this); 159 var oldCrumbs = outermostViewHost.Breadcrumbs; 160 var newCrumbs = BuildBreadcrumbTrail(); 161 mainForm.ShowContentInSpecificViewHost(item, outermostViewHost); 162 outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 152 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this); 163 153 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 164 154 outermostViewHost.ActiveView.Locked = Locked; … … 191 181 } 192 182 } 193 private IEnumerable<IContent> BuildBreadcrumbTrail() {194 var l = new LinkedList<IContent>();195 for (var control = (Control)this; control != null; control = control.Parent) {196 var vh = control as ViewHost;197 if (vh != null && vh.Content != null)198 l.AddFirst(vh.Content);199 }200 return l;201 }202 183 } 203 184 }
Note: See TracChangeset
for help on using the changeset viewer.