Changeset 6734 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.TrayIcon/3.3/MainWindow.cs
- Timestamp:
- 09/11/11 21:54:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.TrayIcon/3.3/MainWindow.cs
r6730 r6734 20 20 #endregion 21 21 22 using System; 22 23 using System.Windows.Forms; 23 24 using HeuristicLab.Clients.Hive.SlaveCore.Views; … … 35 36 public MainWindow() { 36 37 InitializeComponent(); 37 slaveMainView. WindowStateChanged += new System.EventHandler<Common.EventArgs<FormWindowState>>(slaveMainView_WindowStateChanged);38 slaveMainView.VisibilitySwitched += new System.EventHandler(slaveMainView_WindowStateChanged); 38 39 } 39 40 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) { 43 43 Hide(); 44 } else if (WindowState == FormWindowState.Normal){44 } else { 45 45 Show(); 46 46 } 47 47 } 48 48 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 } 55 54 } 56 55 }
Note: See TracChangeset
for help on using the changeset viewer.