private void Form_Closing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing && niTray.Visible) { e.Cancel = true; if (Settings.Visible) { Settings.Hide(); } Visible = false; WindowState = FormWindowState.Minimized; } else { tmrUpdate.Enabled = false; m_Config.Visible = FormVisible; m_Config.FormSaved = FormSaved; m_Config.FormX = FormX; m_Config.FormY = FormY; m_Config.ConfSaved = ConfSaved; m_Config.ConfX = ConfX; m_Config.ConfY = ConfY; m_Config.Save(); } }
/// <summary> /// Root hub disconnected, reset user interface to defaults. /// </summary> private void Clear() { if (m_Connected) { m_Connected = false; tmConfig.Enabled = false; tmProfile.Enabled = false; niTray.BalloonTipText = "Server Disconnected"; niTray.ShowBalloonTip(3000); } if (_settings.Visible) { _settings.Hide(); } if (_profiles.Visible) { _profiles.Hide(); } lblHost.Text = "Host Address : Disconnected"; lblPad_1.Text = "Pad 1 : Disconnected"; lblPad_2.Text = "Pad 2 : Disconnected"; lblPad_3.Text = "Pad 3 : Disconnected"; lblPad_4.Text = "Pad 4 : Disconnected"; btnUp_1.Enabled = btnUp_2.Enabled = btnUp_3.Enabled = false; }