Changeset 10042 for branches/Breadcrumbs
- Timestamp:
- 10/15/13 16:11:27 (11 years ago)
- Location:
- branches/Breadcrumbs
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r9755 r10042 140 140 try { 141 141 return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 142 } 143 catch (Exception ex) { 142 } catch (Exception ex) { 144 143 ErrorHandling.ShowErrorDialog(this, ex); 145 144 } … … 246 245 protected virtual void itemsListView_DoubleClick(object sender, EventArgs e) { 247 246 if (itemsListView.SelectedItems.Count == 1) { 248 Titem = itemsListView.SelectedItems[0].Tag as T;247 var item = itemsListView.SelectedItems[0].Tag as T; 249 248 if (item != null) { 250 IContentView view = MainFormManager.MainForm.ShowContent(item); 251 if (view != null) { 252 view.ReadOnly = ReadOnly; 253 view.Locked = Locked; 249 ViewHost outmostViewHost = null; 250 for (var control = Parent; control != null; control = control.Parent) { 251 var vh = control as ViewHost; 252 if (vh != null) outmostViewHost = vh; 253 } 254 if (outmostViewHost != null) { 255 var oldCrumbs = outmostViewHost.Breadcrumbs; 256 var newCrumbs = BuildBreadcrumbTrail(); 257 outmostViewHost.Content = null; 258 var viewType = MainFormManager.GetDefaultViewType(item.GetType()); 259 outmostViewHost.ViewType = viewType; 260 outmostViewHost.Content = item; 261 outmostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 262 outmostViewHost.ActiveView.ReadOnly = ReadOnly; 263 outmostViewHost.ActiveView.Locked = Locked; 254 264 } 255 265 } … … 440 450 } 441 451 } 452 protected virtual IEnumerable<IContent> BuildBreadcrumbTrail() { 453 var l = new LinkedList<IContent>(); 454 for (var control = (Control)this; control != null; control = control.Parent) { 455 var vh = control as ViewHost; 456 if (vh != null && vh.Content != null) 457 l.AddFirst(vh.Content); 458 } 459 return l; 460 } 442 461 #endregion 443 462 } -
branches/Breadcrumbs/HeuristicLab.Core.Views/3.3/ItemListView.cs
r9755 r10042 146 146 try { 147 147 return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 148 } 149 catch (Exception ex) { 148 } catch (Exception ex) { 150 149 ErrorHandling.ShowErrorDialog(this, ex); 151 150 } … … 267 266 protected virtual void itemsListView_DoubleClick(object sender, EventArgs e) { 268 267 if (itemsListView.SelectedItems.Count == 1) { 269 Titem = itemsListView.SelectedItems[0].Tag as T;268 var item = itemsListView.SelectedItems[0].Tag as T; 270 269 if (item != null) { 271 IContentView view = MainFormManager.MainForm.ShowContent(item); 272 if (view != null) { 273 view.ReadOnly = ReadOnly; 274 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; 275 285 } 276 286 } … … 506 516 } 507 517 } 518 protected virtual IEnumerable<IContent> BuildBreadcrumbTrail() { 519 var l = new LinkedList<IContent>(); 520 for (var control = (Control)this; control != null; control = control.Parent) { 521 var vh = control as ViewHost; 522 if (vh != null && vh.Content != null) 523 l.AddFirst(vh.Content); 524 } 525 return l; 526 } 508 527 #endregion 509 528 } -
branches/Breadcrumbs/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs
r9456 r10042 27 27 using HeuristicLab.Collections; 28 28 using HeuristicLab.MainForm; 29 using HeuristicLab.MainForm.WindowsForms; 29 30 30 31 namespace HeuristicLab.Core.Views { … … 152 153 protected override void itemsListView_DoubleClick(object sender, EventArgs e) { 153 154 if (itemsListView.SelectedItems.Count == 1) { 154 IParameter item = itemsListView.SelectedItems[0].Tag as IParameter;155 var item = itemsListView.SelectedItems[0].Tag as IParameter; 155 156 if (item != null) { 156 IContentView view = MainFormManager.MainForm.ShowContent(item); 157 if (view != null) { 158 view.ReadOnly = ReadOnly || (item.Hidden && !AllowEditingOfHiddenParameters); 159 view.Locked = Locked; 157 ViewHost outmostViewHost = null; 158 for (var control = Parent; control != null; control = control.Parent) { 159 var vh = control as ViewHost; 160 if (vh != null) outmostViewHost = vh; 161 } 162 if (outmostViewHost != null) { 163 var oldCrumbs = outmostViewHost.Breadcrumbs; 164 var newCrumbs = BuildBreadcrumbTrail(); 165 outmostViewHost.Content = null; 166 var viewType = MainFormManager.GetDefaultViewType(item.GetType()); 167 outmostViewHost.ViewType = viewType; 168 outmostViewHost.Content = item; 169 outmostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 170 outmostViewHost.ActiveView.ReadOnly = ReadOnly; 171 outmostViewHost.ActiveView.Locked = Locked; 160 172 } 161 173 } -
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewContextMenuStrip.cs
r9456 r10042 30 30 public ViewContextMenuStrip() { 31 31 InitializeComponent(); 32 this.menuItems = new Dictionary<Type, ToolStripMenuItem>();33 this.ignoredViewTypes = new List<Type>();32 menuItems = new Dictionary<Type, ToolStripMenuItem>(); 33 ignoredViewTypes = new List<Type>(); 34 34 } 35 35 36 36 public ViewContextMenuStrip(IContainer container) 37 37 : base(container) { 38 InitializeComponent(); 39 this.menuItems = new Dictionary<Type, ToolStripMenuItem>(); 40 this.ignoredViewTypes = new List<Type>(); 38 InitializeComponent(); 39 menuItems = new Dictionary<Type, ToolStripMenuItem>(); 40 ignoredViewTypes = new List<Type>(); 41 ShowBreadcrumbsToolStripMenuItem = new ToolStripMenuItem("Show Breadcrumbs"); 42 ShowBreadcrumbsToolStripMenuItem.Click += ShowBreadcrumbsToolStripMenuItem_Click; 43 ShowBreadcrumbsToolStripMenuItem.CheckedChanged += ShowBreadcrumbsToolStripMenuItem_CheckedChanged; 41 44 } 42 45 43 46 private object item; 44 47 public object Item { 45 get { return this.item; }48 get { return item; } 46 49 set { 47 if ( this.item != value) {48 this.item = value;49 this.RefreshMenuItems();50 if (item != value) { 51 item = value; 52 RefreshMenuItems(); 50 53 } 51 54 } … … 54 57 private List<Type> ignoredViewTypes; 55 58 public IEnumerable<Type> IgnoredViewTypes { 56 get { return this.ignoredViewTypes; }57 set { this.ignoredViewTypes = new List<Type>(value); RefreshMenuItems(); }59 get { return ignoredViewTypes; } 60 set { ignoredViewTypes = new List<Type>(value); RefreshMenuItems(); } 58 61 } 59 62 60 63 private Dictionary<Type, ToolStripMenuItem> menuItems; 61 64 public IEnumerable<KeyValuePair<Type, ToolStripMenuItem>> MenuItems { 62 get { return this.menuItems; }65 get { return menuItems; } 63 66 } 67 68 public ToolStripMenuItem ShowBreadcrumbsToolStripMenuItem { get; private set; } 64 69 65 70 private void RefreshMenuItems() { … … 68 73 foreach (ToolStripMenuItem m in menuItems.Values) 69 74 m.Dispose(); 70 this.Items.Clear();71 this.menuItems.Clear();75 Items.Clear(); 76 menuItems.Clear(); 72 77 73 if ( this.item != null) {78 if (item != null) { 74 79 ToolStripMenuItem menuItem; 75 80 IEnumerable<Type> types = MainFormManager.GetViewTypes(item.GetType(), true); … … 79 84 menuItem.Text = ViewAttribute.GetViewName(t); 80 85 81 this.menuItems.Add(t, menuItem);82 this.Items.Add(menuItem);86 menuItems.Add(t, menuItem); 87 Items.Add(menuItem); 83 88 } 89 if (Items.Count > 0) 90 Items.Add(new ToolStripSeparator()); 91 Items.Add(ShowBreadcrumbsToolStripMenuItem); 84 92 } 85 93 } 86 94 } 95 96 public event EventHandler ShowBreadcrumbsChanged; 97 private void OnShowBreadcrumbsChanged() { 98 var handler = ShowBreadcrumbsChanged; 99 if (handler != null) handler(this, EventArgs.Empty); 100 } 101 102 private void ShowBreadcrumbsToolStripMenuItem_CheckedChanged(object sender, EventArgs e) { 103 OnShowBreadcrumbsChanged(); 104 } 105 106 private void ShowBreadcrumbsToolStripMenuItem_Click(object sender, EventArgs e) { 107 ShowBreadcrumbsToolStripMenuItem.Checked = !ShowBreadcrumbsToolStripMenuItem.Checked; 108 } 87 109 } 88 110 } -
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.Designer.cs
r9920 r10042 52 52 this.configurationLabel = new System.Windows.Forms.Label(); 53 53 this.helpLabel = new System.Windows.Forms.Label(); 54 this.breadcrumbControl = new HeuristicLab.MainForm.WindowsForms.BreadcrumbControl(); 54 55 this.SuspendLayout(); 55 56 // … … 86 87 this.viewContextMenuStrip.Name = "viewContextMenuStrip"; 87 88 this.viewContextMenuStrip.Size = new System.Drawing.Size(61, 4); 89 this.viewContextMenuStrip.ShowBreadcrumbsChanged += new System.EventHandler(this.viewContextMenuStrip_ShowBreadcrumbsChanged); 88 90 this.viewContextMenuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.viewContextMenuStrip_ItemClicked); 89 91 // … … 114 116 this.helpLabel.DoubleClick += new System.EventHandler(this.helpLabel_DoubleClick); 115 117 // 118 // breadcrumbControl 119 // 120 this.breadcrumbControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 121 | System.Windows.Forms.AnchorStyles.Right))); 122 this.breadcrumbControl.Location = new System.Drawing.Point(0, 0); 123 this.breadcrumbControl.Name = "breadcrumbControl"; 124 this.breadcrumbControl.Size = new System.Drawing.Size(202, 15); 125 this.breadcrumbControl.TabIndex = 4; 126 this.breadcrumbControl.ViewHost = null; 127 // 116 128 // ViewHost 117 129 // 118 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);119 130 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 131 this.Controls.Add(this.breadcrumbControl); 120 132 this.Controls.Add(this.helpLabel); 121 133 this.Controls.Add(this.viewsLabel); … … 124 136 this.Name = "ViewHost"; 125 137 this.Size = new System.Drawing.Size(227, 184); 138 this.VisibleChanged += new System.EventHandler(this.ViewHost_VisibleChanged); 126 139 this.ResumeLayout(false); 127 140 … … 135 148 private System.Windows.Forms.Label configurationLabel; 136 149 private System.Windows.Forms.Label helpLabel; 150 private BreadcrumbControl breadcrumbControl; 137 151 138 152 } -
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
r9921 r10042 33 33 InitializeComponent(); 34 34 startDragAndDrop = false; 35 viewContextMenuStrip.IgnoredViewTypes = new List<Type> (){ typeof(ViewHost) };35 viewContextMenuStrip.IgnoredViewTypes = new List<Type> { typeof(ViewHost) }; 36 36 37 37 viewType = null; … … 41 41 viewsLabel.Visible = false; 42 42 viewsLabelVisible = true; 43 44 breadcrumbControl.ViewHost = this; 43 45 } 44 46 … … 51 53 viewsLabel.Visible = value; 52 54 View view = activeView as View; 53 if (view != null) view.Dock = viewsLabelVisible ? DockStyle.None : DockStyle.Fill;55 if (view != null) AdjustActiveViewSize(); 54 56 } 55 57 } … … 87 89 #endregion 88 90 89 this.Caption = activeView.Caption;91 Caption = activeView.Caption; 90 92 viewType = activeView.GetType(); 91 93 RegisterActiveViewEvents(); … … 93 95 if (view != null) { 94 96 view.Visible = true; 95 if (ViewsLabelVisible) { 96 view.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; 97 view.Size = new Size(Width - this.viewsLabel.Width - this.viewsLabel.Margin.Left - this.viewsLabel.Margin.Right, this.Height); 98 } else view.Dock = DockStyle.Fill; 97 AdjustActiveViewSize(); 99 98 if (!Controls.Contains((view))) Controls.Add(view); 100 99 view.OnShown(new ViewShownEventArgs(view, false)); … … 125 124 } 126 125 } 126 127 public bool ShowBreadcrumbs { 128 get { return viewContextMenuStrip.ShowBreadcrumbsToolStripMenuItem.Checked; } 129 set { viewContextMenuStrip.ShowBreadcrumbsToolStripMenuItem.Checked = value; } 130 } 131 132 private bool isOutmostViewHost; 133 public IEnumerable<IContent> Breadcrumbs { get { return breadcrumbControl.Breadcrumbs; } } 127 134 128 135 protected override void SetEnabledStateOfControls() { … … 151 158 UpdateLabels(); 152 159 UpdateActiveMenuItem(); 160 UpdateBreadcrumbControl(); 153 161 } 154 162 … … 201 209 OnChanged(); 202 210 } 211 private void ViewHost_VisibleChanged(object sender, EventArgs e) { 212 PerformOuterViewHostDetection(); 213 } 214 private void viewContextMenuStrip_ShowBreadcrumbsChanged(object sender, EventArgs e) { 215 UpdateBreadcrumbControl(); 216 AdjustActiveViewSize(); 217 } 203 218 204 219 protected override void OnSizeChanged(EventArgs e) { … … 263 278 } 264 279 280 private void UpdateBreadcrumbControl() { 281 breadcrumbControl.Visible = ShowBreadcrumbs; 282 if (ShowBreadcrumbs) 283 UpdateBreadcrumbTrail(breadcrumbControl.Breadcrumbs, BuildBreadcrumbTrail()); 284 } 285 265 286 private bool ViewCanShowContent(Type viewType, object content) { 266 287 if (content == null) // every view can display null … … 274 295 IContentView view = MainFormManager.MainForm.ShowContent(this.Content, this.ViewType); 275 296 if (view != null) { 276 view.ReadOnly = this.ReadOnly;277 view.Locked = this.Locked;297 view.ReadOnly = ReadOnly; 298 view.Locked = Locked; 278 299 } 279 300 } … … 285 306 private bool startDragAndDrop; 286 307 private void viewsLabel_MouseDown(object sender, MouseEventArgs e) { 287 if (e.Button == System.Windows.Forms.MouseButtons.Right) {308 if (e.Button == MouseButtons.Right) { 288 309 Screen screen = Screen.FromControl(viewsLabel); 289 int rightBorder = viewsLabel.PointToScreen(viewsLabel.Location).X + viewContextMenuStrip.Width; //310 int rightBorder = viewsLabel.PointToScreen(viewsLabel.Location).X + viewContextMenuStrip.Width; 290 311 rightBorder = rightBorder - screen.Bounds.X; //pixel position on active screen 291 312 … … 319 340 } 320 341 #endregion 342 343 #region Helpers 344 private void AdjustActiveViewSize() { 345 var view = activeView as View; 346 if (view == null) return; 347 int width = viewsLabelVisible ? Width - viewsLabel.Width - viewsLabel.Margin.Left - viewsLabel.Margin.Right : Width; 348 int height = ShowBreadcrumbs ? Height - viewsLabel.Height - viewsLabel.Margin.Top - viewsLabel.Margin.Bottom : Height; 349 view.Location = new Point(0, Height - height); 350 view.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; 351 view.Size = new Size(width, height); 352 } 353 354 private IEnumerable<IContent> BuildBreadcrumbTrail() { 355 var ll = new LinkedList<IContent>(); 356 for (var control = (Control)this; control != null; control = control.Parent) { 357 var viewHost = control as ViewHost; 358 if (viewHost != null && viewHost.Content != null) 359 ll.AddFirst(viewHost.Content); 360 } 361 return ll; 362 } 363 364 public void UpdateBreadcrumbTrail(IEnumerable<IContent> oldCrumbs, IEnumerable<IContent> newCrumbs) { 365 if (!newCrumbs.Any()) return; 366 var ll = new LinkedList<IContent>(); 367 foreach (var c in oldCrumbs) { 368 if (c != newCrumbs.First()) 369 ll.AddLast(c); 370 else break; 371 } 372 foreach (var c in newCrumbs) 373 ll.AddLast(c); 374 breadcrumbControl.Breadcrumbs = ll; 375 } 376 377 private void PerformOuterViewHostDetection() { 378 var outmostViewHost = this; 379 for (var parent = Parent; parent != null; parent = parent.Parent) { 380 var vh = parent as ViewHost; 381 if (vh != null) outmostViewHost = vh; 382 } 383 isOutmostViewHost = outmostViewHost == this; 384 viewContextMenuStrip.ShowBreadcrumbsToolStripMenuItem.Checked = isOutmostViewHost; 385 } 386 #endregion 321 387 } 322 388 } -
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/HeuristicLab.MainForm.WindowsForms-3.3.csproj
r9915 r10042 120 120 <ItemGroup> 121 121 <Compile Include="ActionUserInterfaceItem.cs" /> 122 <Compile Include="Controls\BreadcrumbControl.cs"> 123 <SubType>UserControl</SubType> 124 </Compile> 125 <Compile Include="Controls\BreadcrumbControl.Designer.cs"> 126 <DependentUpon>BreadcrumbControl.cs</DependentUpon> 127 </Compile> 122 128 <Compile Include="Controls\DragOverTabControl.cs"> 123 129 <SubType>Component</SubType> -
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/ResultCollectionView.cs
r9456 r10042 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Core.Views; 25 24 using HeuristicLab.MainForm; 25 using HeuristicLab.MainForm.WindowsForms; 26 26 27 27 namespace HeuristicLab.Optimization.Views { … … 33 33 public override bool ReadOnly { 34 34 get { return true; } 35 set { /* not needed because results are always readonly */}35 set { /* not needed because results are always readonly */} 36 36 } 37 37 … … 45 45 return null; 46 46 } 47 48 protected override void itemsListView_DoubleClick(object sender, EventArgs e) {49 if (itemsListView.SelectedItems.Count == 1) {50 IResult result = itemsListView.SelectedItems[0].Tag as IResult;51 if (result != null) {52 IContentView view = MainFormManager.MainForm.ShowContent(result, typeof(ResultView));53 if (view != null) {54 view.ReadOnly = ReadOnly;55 view.Locked = Locked;56 }57 }58 }59 }60 47 } 61 48 } -
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 } -
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunView.cs
r9456 r10042 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 23 25 using System.Windows.Forms; 24 26 using HeuristicLab.Common; … … 26 28 using HeuristicLab.Core.Views; 27 29 using HeuristicLab.MainForm; 30 using HeuristicLab.MainForm.WindowsForms; 28 31 29 32 namespace HeuristicLab.Optimization.Views { … … 139 142 private void listView_DoubleClick(object sender, EventArgs e) { 140 143 if (listView.SelectedItems.Count == 1) { 141 IItem item = (IItem)listView.SelectedItems[0].Tag; 142 IContentView view = MainFormManager.MainForm.ShowContent(item); 143 if (view != null) { 144 view.ReadOnly = true; 145 view.Locked = Locked; 144 var item = listView.SelectedItems[0].Tag as IItem; 145 if (item != null) { 146 ViewHost outmostViewHost = null; 147 for (var control = Parent; control != null; control = control.Parent) { 148 var vh = control as ViewHost; 149 if (vh != null) outmostViewHost = vh; 150 } 151 if (outmostViewHost != null) { 152 var oldCrumbs = outmostViewHost.Breadcrumbs; 153 var newCrumbs = BuildBreadcrumbTrail(); 154 outmostViewHost.Content = null; 155 var viewType = MainFormManager.GetDefaultViewType(item.GetType()); 156 outmostViewHost.ViewType = viewType; 157 outmostViewHost.Content = item; 158 outmostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item })); 159 outmostViewHost.ActiveView.ReadOnly = ReadOnly; 160 outmostViewHost.ActiveView.Locked = Locked; 161 } 146 162 } 147 163 } … … 173 189 } 174 190 } 191 private IEnumerable<IContent> BuildBreadcrumbTrail() { 192 var l = new LinkedList<IContent>(); 193 for (var control = (Control)this; control != null; control = control.Parent) { 194 var vh = control as ViewHost; 195 if (vh != null && vh.Content != null) 196 l.AddFirst(vh.Content); 197 } 198 return l; 199 } 175 200 } 176 201 }
Note: See TracChangeset
for help on using the changeset viewer.