Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/29/10 15:10:17 (14 years ago)
Author:
mkommend
Message:

changed logic of showing new views (ticket #972)

File:
1 edited

Legend:

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

    r3552 r3557  
    2828
    2929namespace HeuristicLab.MainForm.WindowsForms {
    30   [Content(typeof(object))]
     30  [Content(typeof(IContent))]
    3131  public sealed partial class ViewHost : AsynchronousContentView {
    3232    public ViewHost() {
     
    3939      Content = null;
    4040      OnContentChanged();
    41     }
    42     public ViewHost(IContent content)
    43       : this() {
    44       this.Content = content;
    45     }
    46 
    47     public ViewHost(IContentView contentView)
    48       : this() {
    49       this.viewType = contentView.GetType();
    50       this.Content = contentView.Content;
    51       this.cachedViews.Add(contentView.GetType(), contentView);
    52       this.activeView = contentView;
    53       this.RegisterActiveViewEvents();
    54       this.OnViewTypeChanged();
    55       this.ActiveViewChanged();
    5641    }
    5742
     
    117102    }
    118103
    119 
    120 
    121104    protected override void OnContentChanged() {
    122105      messageLabel.Visible = false;
     
    133116        }
    134117
    135 
    136118        if (!ViewCanShowContent(viewType, Content)) {
    137119          ViewType = MainFormManager.GetDefaultViewType(Content.GetType());
     
    148130      }
    149131    }
    150 
    151132
    152133    private void OnViewTypeChanged() {
     
    176157    }
    177158
    178 
    179 
    180159    private void RegisterActiveViewEvents() {
    181160      activeView.Changed += new EventHandler(activeView_Changed);
     
    256235
    257236    private void viewsLabel_DoubleClick(object sender, EventArgs e) {
    258       IContentView view = MainFormManager.CreateView(viewType, Content);
     237      IContentView view = MainFormManager.MainForm.ShowContent(this.Content);
    259238      view.ReadOnly = this.ReadOnly;
    260239      view.Locked = this.Locked;
    261       view.Show();
    262240    }
    263241    private void viewContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.