Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/29/10 16:26:43 (15 years ago)
Author:
mkommend
Message:

corrected MainForm.ActiveViewChanged event and View.IsShown property (ticket #857)

File:
1 edited

Legend:

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

    r2711 r2723  
    5858    public bool IsShown {
    5959      get { return this.isShown; }
     60      private set { this.isShown = value; }
    6061    }
    6162
     
    6465      bool firstTimeShown = mainform.GetForm(this) == null;
    6566
    66       MainFormManager.GetMainForm<MainForm>().ShowView(this,firstTimeShown);
     67      this.IsShown = true;
     68      mainform.ShowView(this, firstTimeShown);
    6769      if (firstTimeShown) {
    6870        Form form = mainform.GetForm(this);
     
    7072        form.FormClosing += new FormClosingEventHandler(OnClosingHelper);
    7173      }
    72       this.OnShown(new ViewShownEventArgs(this,firstTimeShown));
     74      this.OnShown(new ViewShownEventArgs(this, firstTimeShown));
    7375    }
    7476
     
    7678      MainForm mainform = MainFormManager.GetMainForm<MainForm>();
    7779      Form form = mainform.GetForm(this);
    78       if (form != null)
     80      if (form != null) {
     81        this.IsShown = false;
    7982        mainform.CloseView(this);
     83      }
    8084    }
    8185
     
    8387      MainForm mainform = MainFormManager.GetMainForm<MainForm>();
    8488      Form form = mainform.GetForm(this);
    85       if (form != null)
    86         mainform.CloseView(this,closeReason);
     89      if (form != null) {
     90        this.IsShown = false;
     91        mainform.CloseView(this, closeReason);
     92      }
    8793    }
    8894
    8995    public new void Hide() {
     96      this.IsShown = false;
    9097      MainFormManager.GetMainForm<MainForm>().HideView(this);
    9198      this.OnHidden(new EventArgs());
     
    107114
    108115    protected virtual void OnShown(ViewShownEventArgs e) {
    109       this.isShown = true;
    110116    }
    111117
    112118    protected virtual void OnHidden(EventArgs e) {
    113       this.isShown = false;
    114119    }
    115120
     
    140145
    141146    protected virtual void OnClosed(FormClosedEventArgs e) {
    142       this.isShown = false;
    143147    }
    144148
Note: See TracChangeset for help on using the changeset viewer.