Changeset 10106
- Timestamp:
- 11/05/13 10:52:45 (11 years ago)
- Location:
- branches/Breadcrumbs
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.Clients.Access.Administration/3.3/Views/RoleView.cs
r9456 r10106 47 47 48 48 private void roleNameTextBox_TextChanged(object sender, System.EventArgs e) { 49 if (Content .Name != roleNameTextBox.Text)49 if (Content != null && Content.Name != roleNameTextBox.Text) 50 50 Content.Name = roleNameTextBox.Text; 51 51 } -
branches/Breadcrumbs/HeuristicLab.Clients.Access.Administration/3.3/Views/UserGroupView.cs
r9456 r10106 69 69 70 70 private void groupNameTextBox_TextChanged(object sender, System.EventArgs e) { 71 if (Content .Name != this.groupNameTextBox.Text)71 if (Content != null && Content.Name != this.groupNameTextBox.Text) 72 72 Content.Name = this.groupNameTextBox.Text; 73 73 } -
branches/Breadcrumbs/HeuristicLab.Clients.Access.Administration/3.3/Views/UserView.cs
r9456 r10106 72 72 73 73 private void fullNameTextBox_TextChanged(object sender, System.EventArgs e) { 74 if (Content .FullName != fullNameTextBox.Text)74 if (Content != null && Content.FullName != fullNameTextBox.Text) 75 75 Content.FullName = fullNameTextBox.Text; 76 76 } 77 77 78 78 private void userNameTextBox_TextChanged(object sender, System.EventArgs e) { 79 if (Content .UserName != userNameTextBox.Text)79 if (Content != null && Content.UserName != userNameTextBox.Text) 80 80 Content.UserName = userNameTextBox.Text; 81 81 } 82 82 83 83 private void emailTextBox_TextChanged(object sender, System.EventArgs e) { 84 if (Content .Email != emailTextBox.Text)84 if (Content != null && Content.Email != emailTextBox.Text) 85 85 Content.Email = emailTextBox.Text; 86 86 } -
branches/Breadcrumbs/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs
r10103 r10106 180 180 this.viewHost.Caption = "View"; 181 181 this.viewHost.Content = null; 182 this.viewHost.IsValidOutermostViewhost = false;183 182 this.viewHost.Location = new System.Drawing.Point(6, 19); 184 183 this.viewHost.Name = "viewHost"; -
branches/Breadcrumbs/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs
r10103 r10106 193 193 this.viewHost.Caption = "View"; 194 194 this.viewHost.Content = null; 195 this.viewHost.IsValidOutermostViewhost = false;196 195 this.viewHost.Location = new System.Drawing.Point(6, 19); 197 196 this.viewHost.Name = "viewHost"; -
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 -
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Views/View.cs
r9920 r10106 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using System.Reflection; … … 261 262 ((Control)this).ResumeRepaint(refresh); 262 263 } 264 265 public IEnumerable<T> GetParentViewsOfType<T>() where T : View { 266 for (var view = Parent; view != null; view = view.Parent) 267 if (view is View) yield return view as T; 268 } 263 269 } 264 270 } -
branches/Breadcrumbs/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.Designer.cs
r10103 r10106 235 235 | System.Windows.Forms.AnchorStyles.Right))); 236 236 this.detailsViewHost.Content = null; 237 this.detailsViewHost.IsValidOutermostViewhost = false;238 237 this.detailsViewHost.Location = new System.Drawing.Point(3, 16); 239 238 this.detailsViewHost.Name = "detailsViewHost"; -
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.Designer.cs
r10103 r10106 216 216 this.viewHost.Caption = "View"; 217 217 this.viewHost.Content = null; 218 this.viewHost.IsValidOutermostViewhost = false;219 218 this.viewHost.Location = new System.Drawing.Point(6, 19); 220 219 this.viewHost.Name = "viewHost"; -
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunView.Designer.cs
r10103 r10106 178 178 this.viewHost.Content = null; 179 179 this.viewHost.Enabled = false; 180 this.viewHost.IsValidOutermostViewhost = false;181 180 this.viewHost.Location = new System.Drawing.Point(6, 19); 182 181 this.viewHost.Name = "viewHost";
Note: See TracChangeset
for help on using the changeset viewer.