private void BtnClose_Click(object sender, RoutedEventArgs e) { try { // Save position Properties.Settings.Default.WindowTop = Top; Properties.Settings.Default.WindowLeft = Left; Properties.Settings.Default.WindowHeight = Height; Properties.Settings.Default.Save(); // Stop tugManager.Disable(); simConnectManager.Stop(); listener.UnHookKeyboard(); } catch (Exception) { } Close(); }
public void ExitApp() { try { // Save position if (WindowState == WindowState.Normal) { Properties.Settings.Default.WindowTop = Top; Properties.Settings.Default.WindowLeft = Left; Properties.Settings.Default.WindowHeight = Height; } Properties.Settings.Default.TugSpeed = tugManager.SpeedFactor; Properties.Settings.Default.Save(); // Stop tugManager.Disable(); simConnectManager.Stop(); listener.UnHookKeyboard(); } catch (Exception) { } Close(); }