internal static void InitShutdownSequence() { foreach (Bot bot in Bot.Bots.Values.Where(bot => bot.KeepRunning)) { bot.Stop(); } }
private async void MainForm_FormClosed(object sender, FormClosedEventArgs e) => await Program.InitShutdownSequence().ConfigureAwait(false);