- Timestamp:
- 05/06/10 13:20:01 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForm.cs
r3557 r3670 222 222 223 223 public IContentView ShowContent(IContent content) { 224 Type viewType = MainFormManager.GetDefaultViewType(content.GetType()); 225 if (viewType != null) 226 return ShowContent(content, viewType); 227 return null; 228 } 229 230 internal IContentView ShowContent(IContent content, Type viewType) { 231 if (viewType == null) 232 throw new ArgumentNullException("Could not create view of type null"); 233 224 234 IContentView view; 225 if (this.ShowContentInViewHost) 226 view = new ViewHost(); 227 else 228 view = MainFormManager.CreateDefaultView(content.GetType()); 235 if (this.ShowContentInViewHost) { 236 ViewHost viewHost = new ViewHost(); 237 viewHost.ViewType = viewType; 238 view = viewHost; 239 } else 240 view = MainFormManager.CreateView(viewType); 229 241 230 242 if (view != null) { -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs
r3664 r3670 248 248 249 249 private void viewsLabel_DoubleClick(object sender, EventArgs e) { 250 IContentView view = MainFormManager.MainForm.ShowContent(this.Content); 251 view.ReadOnly = this.ReadOnly; 252 view.Locked = this.Locked; 250 IContentView view = MainFormManager.GetMainForm<MainForm>().ShowContent(this.Content,this.ViewType); 251 if (view != null) { 252 view.ReadOnly = this.ReadOnly; 253 view.Locked = this.Locked; 254 } 253 255 } 254 256 private void viewContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.