- Timestamp:
- 01/13/15 13:15:03 (10 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11555,11557,11592,11736
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj
r8600 r11748 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) -
stable/HeuristicLab.Core.Views/3.3/ItemView.cs
r11170 r11748 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 } -
stable/HeuristicLab.Core.Views/3.3/NestingLevelErrorControl.Designer.cs
r11555 r11748 61 61 // showButton 62 62 // 63 this.showButton.Location = new System.Drawing.Point( 3, 19);63 this.showButton.Location = new System.Drawing.Point(7, 21); 64 64 this.showButton.Name = "showButton"; 65 65 this.showButton.Size = new System.Drawing.Size(132, 23); … … 75 75 this.Controls.Add(this.infoLabel); 76 76 this.Name = "NestingLevelErrorControl"; 77 this.Size = new System.Drawing.Size(387, 46);77 this.Size = new System.Drawing.Size(387, 50); 78 78 this.ResumeLayout(false); 79 79 this.PerformLayout(); -
stable/HeuristicLab.Core.Views/3.3/NestingLevelErrorControl.cs
r11555 r11748 27 27 namespace HeuristicLab.Core.Views { 28 28 public partial class NestingLevelErrorControl : UserControl { 29 public Func<IContent> Content { get; set; } 29 private Func<IContent> Content { get; set; } 30 private Type ViewType { get; set; } 30 31 31 public NestingLevelErrorControl() { 32 public NestingLevelErrorControl(Func<IContent> content, Type viewType) 33 : base() { 32 34 InitializeComponent(); 35 Content = content; 36 ViewType = viewType; 33 37 } 34 38 35 39 private void showButton_Click(object sender, System.EventArgs e) { 36 if (Content != null) { 37 if (MainFormManager.MainForm.ShowContent(Content()) == null) { 38 using (TypeSelectorDialog dialog = new TypeSelectorDialog()) { 39 dialog.Caption = "Unable to find view for content. Please choose a appropriate view."; 40 dialog.TypeSelector.Configure(typeof(IContentView), false, false); 41 42 if (dialog.ShowDialog(this) == DialogResult.OK) { 43 MainFormManager.MainForm.ShowContent(Content(), dialog.TypeSelector.SelectedType); 44 } 45 } 46 } 40 if (Content != null && ViewType != null) { 41 MainFormManager.MainForm.ShowContent(Content(), ViewType); 47 42 } 48 43 }
Note: See TracChangeset
for help on using the changeset viewer.