Changeset 3281 for trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2
- Timestamp:
- 04/07/10 11:38:19 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockForm.cs
r2790 r3281 37 37 InitializeComponent(); 38 38 this.view = view; 39 if ( View != null) {39 if (view != null) { 40 40 if (view is UserControl) { 41 41 switch (((UserControl)view).Dock) { … … 53 53 break; 54 54 } 55 Control control = (Control)View; 55 Type viewType = view.GetType(); 56 Control control = (Control)view; 56 57 control.Dock = DockStyle.Fill; 57 this.Size = control.Size; 58 viewPanel.Controls.Add(control); 59 View.CaptionChanged += new EventHandler(View_CaptionChanged); 58 this.view.CaptionChanged += new EventHandler(View_CaptionChanged); 60 59 UpdateText(); 60 61 ContentView contentView = view as ContentView; 62 if (ViewAttribute.GetShowInViewHost(viewType) && contentView != null) { 63 ViewHost viewHost = new ViewHost(); 64 viewHost.ViewType = viewType; 65 viewHost.Content = contentView.Content; 66 viewHost.Dock = DockStyle.Fill; 67 viewPanel.Controls.Add(viewHost); 68 } else 69 viewPanel.Controls.Add(control); 61 70 } 62 71 } else { … … 69 78 } 70 79 } 71 72 80 private IView view; 73 81 public IView View { 74 get { return view; }82 get { return this.view; } 75 83 } 76 84 … … 79 87 Invoke(new MethodInvoker(UpdateText)); 80 88 else 81 this.Text = View.Caption;89 this.Text = this.View.Caption; 82 90 } 83 91 -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DocumentForm.Designer.cs
r2790 r3281 32 32 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> 33 33 protected override void Dispose(bool disposing) { 34 if ( View != null)35 View.CaptionChanged -= new System.EventHandler(View_CaptionChanged);34 if (view != null) 35 view.CaptionChanged -= new System.EventHandler(View_CaptionChanged); 36 36 if (disposing && (components != null)) { 37 37 components.Dispose(); -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DocumentForm.cs
r2790 r3281 30 30 namespace HeuristicLab.MainForm.WindowsForms { 31 31 internal partial class DocumentForm : Form { 32 private IView myView; 33 public IView View { 34 get { return myView; } 35 } 32 private IView view; 36 33 37 34 public DocumentForm() { … … 40 37 public DocumentForm(IView view) 41 38 : this() { 42 myView = view; 43 if (View != null) { 44 Control control = (Control)View; 39 this.view = view; 40 if (view != null) { 41 Type viewType = view.GetType(); 42 Control control = (Control)view; 45 43 control.Dock = DockStyle.Fill; 46 viewPanel.Controls.Add(control); 47 View.CaptionChanged += new EventHandler(View_CaptionChanged); 44 view.CaptionChanged += new EventHandler(View_CaptionChanged); 48 45 UpdateText(); 46 47 ContentView contentView = view as ContentView; 48 if (ViewAttribute.GetShowInViewHost(viewType) && contentView != null) { 49 ViewHost viewHost = new ViewHost(); 50 viewHost.ViewType = viewType; 51 viewHost.Content = contentView.Content; 52 viewHost.Dock = DockStyle.Fill; 53 viewPanel.Controls.Add(viewHost); 54 } else 55 viewPanel.Controls.Add(control); 49 56 } else { 50 57 Label errorLabel = new Label(); … … 61 68 Invoke(new MethodInvoker(UpdateText)); 62 69 else 63 Text = View.Caption;70 Text = view.Caption; 64 71 } 65 72 -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/HeuristicLab.MainForm.WindowsForms-3.2.csproj
r3227 r3281 152 152 <DependentUpon>ViewContextMenuStrip.cs</DependentUpon> 153 153 </Compile> 154 <Compile Include="ViewHost.cs"> 155 <SubType>UserControl</SubType> 156 </Compile> 157 <Compile Include="ViewHost.Designer.cs"> 158 <DependentUpon>ViewHost.cs</DependentUpon> 159 </Compile> 154 160 </ItemGroup> 155 161 <ItemGroup> … … 158 164 </ItemGroup> 159 165 <ItemGroup> 166 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.2\HeuristicLab.Common.Resources-3.2.csproj"> 167 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 168 <Name>HeuristicLab.Common.Resources-3.2</Name> 169 </ProjectReference> 160 170 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.WinFormsUI\2.3.1\WinFormsUI-2.3.1\WinFormsUI-2.3.1.csproj"> 161 171 <Project>{1849A92E-DCFC-4E05-BB0A-D7B7A3DAFCFB}</Project> -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/HeuristicLabMainFormWindowsFormsPlugin.cs.frame
r2790 r3281 27 27 namespace HeuristicLab.MainForm.WindowsForms { 28 28 [Plugin("HeuristicLab.MainForm.WindowsForms", "3.2.0.$WCREV$")] 29 [PluginFile("HeuristicLab.MainForm.WindowsForms-3.2.dll", PluginFileType.Assembly)] 29 [PluginFile("HeuristicLab.MainForm.WindowsForms-3.2.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Common.Resources", "3.2")] 30 31 [PluginDependency("HeuristicLab.MainForm", "3.2")] 31 32 [PluginDependency("HeuristicLab.WinFormsUI", "2.3.1")] -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.Designer.cs
r3280 r3281 20 20 #endregion 21 21 22 namespace HeuristicLab. Core.Views {22 namespace HeuristicLab.MainForm.WindowsForms { 23 23 partial class ViewHost { 24 24 /// <summary> -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.cs
r3280 r3281 24 24 using System.Linq; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Common;27 26 using HeuristicLab.MainForm; 28 using HeuristicLab.MainForm.WindowsForms;29 27 30 namespace HeuristicLab. Core.Views {28 namespace HeuristicLab.MainForm.WindowsForms { 31 29 public sealed partial class ViewHost : UserControl { 32 30 private Type viewType; … … 37 35 if (value != null && !ViewCanShowContent(value, content)) 38 36 throw new ArgumentException(string.Format("View \"{0}\" cannot display content \"{1}\".", 39 value.GetPrettyName(), 40 content.GetType().GetPrettyName())); 37 value, content.GetType())); 41 38 viewType = value; 42 39 UpdateView(); … … 110 107 if (!ViewCanShowContent(viewType, content)) 111 108 throw new InvalidOperationException(string.Format("View \"{0}\" cannot display content \"{1}\".", 112 viewType.GetPrettyName(), 113 Content.GetType().GetPrettyName())); 109 viewType, Content.GetType())); 114 110 115 111 UpdateActiveMenuItem();
Note: See TracChangeset
for help on using the changeset viewer.