- Timestamp:
- 11/17/14 16:05:14 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj
r8600 r11555 147 147 <DependentUpon>LogView.cs</DependentUpon> 148 148 </Compile> 149 <Compile Include="NestingLevelErrorControl.cs"> 150 <SubType>UserControl</SubType> 151 </Compile> 152 <Compile Include="NestingLevelErrorControl.Designer.cs"> 153 <DependentUpon>NestingLevelErrorControl.cs</DependentUpon> 154 </Compile> 149 155 <Compile Include="Plugin.cs" /> 150 156 <Compile Include="VariableValueView.cs"> … … 378 384 --> 379 385 <PropertyGroup> 380 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)386 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 381 387 set ProjectDir=$(ProjectDir) 382 388 set SolutionDir=$(SolutionDir) … … 385 391 call PreBuildEvent.cmd 386 392 </PreBuildEvent> 387 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">393 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 388 394 export ProjectDir=$(ProjectDir) 389 395 export SolutionDir=$(SolutionDir) -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemView.cs
r11171 r11555 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 = 37; 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 NestingLevelErrorControl errorControl = new NestingLevelErrorControl(); 50 errorControl.Dock = DockStyle.Fill; 51 //capture content, needed because it is set at a later time 52 errorControl.Content = () => Content; 53 54 Controls.Clear(); 55 Controls.Add(errorControl); 56 } 57 } 58 59 private int CountParentControls() { 60 int cnt = 0; 61 Control parent = Parent; 62 while (parent != null) { 63 parent = parent.Parent; 64 cnt++; 65 } 66 return cnt; 67 } 40 68 } 41 69 }
Note: See TracChangeset
for help on using the changeset viewer.