Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/11/11 21:54:39 (13 years ago)
Author:
ascheibe
Message:

#1233 some minor improvements in the Slave UI and Administrator UI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.TrayIcon/3.3/MainWindow.cs

    r6730 r6734  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Clients.Hive.SlaveCore.Views;
     
    3536    public MainWindow() {
    3637      InitializeComponent();
    37       slaveMainView.WindowStateChanged += new System.EventHandler<Common.EventArgs<FormWindowState>>(slaveMainView_WindowStateChanged);
     38      slaveMainView.VisibilitySwitched += new System.EventHandler(slaveMainView_WindowStateChanged);
    3839    }
    3940
    40     void slaveMainView_WindowStateChanged(object sender, Common.EventArgs<FormWindowState> e) {
    41       WindowState = e.Value;
    42       if (WindowState == FormWindowState.Minimized) {
     41    void slaveMainView_WindowStateChanged(object sender, EventArgs e) {
     42      if (this.Visible) {
    4343        Hide();
    44       } else if (WindowState == FormWindowState.Normal) {
     44      } else {
    4545        Show();
    4646      }
    4747    }
    4848
    49     internal void MinimizeToTray() {
    50       slaveMainView.MinimizeToTray();
    51     }
    52 
    53     internal void RestoreFromTray() {
    54       slaveMainView.RestoreFromTray();
     49    private void MainWindow_FormClosing(object sender, FormClosingEventArgs e) {
     50      if (e.CloseReason == CloseReason.UserClosing) {
     51        e.Cancel = true;
     52        Hide();
     53      }
    5554    }
    5655  }
Note: See TracChangeset for help on using the changeset viewer.