- Timestamp:
- 11/05/13 10:52:45 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
r10103 r10106 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel;25 24 using System.Drawing; 26 25 using System.Linq; … … 42 41 viewsLabel.Visible = false; 43 42 viewsLabelVisible = true; 44 IsValidOutermostViewhost = true;45 43 46 44 breadcrumbControl.ViewHost = this; … … 61 59 62 60 public bool HotlinkingEnabled { get; set; } 63 64 [DefaultValue(true)]65 public bool IsValidOutermostViewhost { get; set; }66 61 67 62 private IContentView cachedView; … … 371 366 if (!newCrumbs.Any()) return; 372 367 var ll = new LinkedList<IContent>(); 373 foreach (var c in oldCrumbs) { 374 if (c != newCrumbs.First()) 375 ll.AddLast(c); 376 else break; 368 if (newCrumbs.Contains(oldCrumbs.LastOrDefault())) { 369 foreach (var c in oldCrumbs) { 370 if (c != newCrumbs.First()) 371 ll.AddLast(c); 372 else break; 373 } 377 374 } 378 375 foreach (var c in newCrumbs) … … 382 379 383 380 private void PerformOutermostViewHostDetection() { 384 if (!IsValidOutermostViewhost) return; 385 var mainForm = MainFormManager.GetMainForm<MainForm>(); 386 if (mainForm == null) return; // needed for designer 387 var outermostViewHost = mainForm.GetOutermostControlOfType<ViewHost>(this); 388 viewContextMenuStrip.ShowBreadcrumbsToolStripMenuItem.Checked = outermostViewHost == this; 381 var parentContentViews = GetParentViewsOfType<ContentView>(); 382 viewContextMenuStrip.ShowBreadcrumbsToolStripMenuItem.Checked = !parentContentViews.Any(); 389 383 } 390 384 #endregion
Note: See TracChangeset
for help on using the changeset viewer.