Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/06/10 13:20:01 (14 years ago)
Author:
mkommend
Message:

corrected opening of views from the ViewHost (ticket #972)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForm.cs

    r3557 r3670  
    222222
    223223    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
    224234      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);
    229241
    230242      if (view != null) {
Note: See TracChangeset for help on using the changeset viewer.