Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/13 13:47:35 (11 years ago)
Author:
jkarder
Message:

#2116:

  • refactored breadcrumb navigation
  • added possibility to navigate to the first invisible breadcrumb via the ellipsis
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunView.cs

    r10089 r10093  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    2523using System.Windows.Forms;
    2624using HeuristicLab.Common;
     
    133131        var item = (IItem)listView.SelectedItems[0].Tag;
    134132        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) {
    141135          outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    142136          outermostViewHost.ActiveView.Locked = Locked;
     
    156150        var item = (IItem)listView.SelectedItems[0].Tag;
    157151        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);
    163153        outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    164154        outermostViewHost.ActiveView.Locked = Locked;
     
    191181      }
    192182    }
    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     }
    202183  }
    203184}
Note: See TracChangeset for help on using the changeset viewer.