Changeset 12694 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemView.cs
- Timestamp:
- 07/09/15 13:07:30 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemView.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 23 using System.Windows.Forms; 22 24 using HeuristicLab.MainForm.WindowsForms; 23 25 … … 27 29 /// </summary> 28 30 public partial class ItemView : AsynchronousContentView { 31 public const int MaximumNestingLevel = 35; 32 29 33 public new IItem Content { 30 34 get { return (IItem)base.Content; } … … 38 42 InitializeComponent(); 39 43 } 44 45 protected override void OnInitialized(EventArgs e) { 46 base.OnInitialized(e); 47 48 if (CountParentControls() > MaximumNestingLevel) { 49 //capture content, needed because it is set at a later time 50 NestingLevelErrorControl errorControl = new NestingLevelErrorControl(() => Content, this.GetType()); 51 errorControl.Dock = DockStyle.Fill; 52 53 Controls.Clear(); 54 Controls.Add(errorControl); 55 } 56 } 57 58 private int CountParentControls() { 59 int cnt = 0; 60 Control parent = Parent; 61 while (parent != null) { 62 parent = parent.Parent; 63 cnt++; 64 } 65 return cnt; 66 } 40 67 } 41 68 }
Note: See TracChangeset
for help on using the changeset viewer.