private void Main_FormClosing(object sender, FormClosingEventArgs e) { TanjiSettings.Save(); if (!_debugging) { e.Cancel = true; Task.Factory.StartNew(Game.Disconnect); } }
private void Game_Disconnected(object sender, EventArgs e) { _game.Disconnected -= Game_Disconnected; if (TanjiSettings.Global.ShouldCloseOnDisconnect) { TanjiSettings.Save(); Environment.Exit(0); } Task.Factory.StartNew(Reinitiate); }
private void TanjiConnect_FormClosing(object sender, FormClosingEventArgs e) { TanjiSettings.Save(); if (!_main.Game.IsConnected) { FiddlerApplication.Shutdown(); _main.Game.Dispose(); Environment.Exit(0); } ResetSetup(); }