private void BotOnOnSteamGuardRequired(object sender, SteamGuardRequiredEventArgs barf) { var bot = sender as Bot; var window = new SteamGuardForm(bot.DisplayName); var dialogResult = window.ShowDialog(); if (dialogResult == DialogResult.OK) { barf.SteamGuard = window.UserEnteredCode; } }