private void UpdateSelelectedBot(object sender, RoutedEventArgs e) { // Cast the sender to a RadioButton, since only those bot selection Radio Buttons should use this event handler. RadioButton radBtn = (RadioButton)sender; // Activate the selected bot. EverWingBot activeBot = GetBotFromRadioButton(radBtn); _bot = activeBot; _hookManager.Activate(_bot); // Update the bot with the coordinates in case they changed while the bot was inactive. _bot.SetLeft(_left); _bot.SetRight(_right); _bot.SetTop(_top); _bot.SetBottom(_bottom); // Update and save the setting for the last bot. Properties.Settings.Default.LastSelectedBotRadioButtonName = radBtn.Name; Properties.Settings.Default.Save(); }
public void Deactivate() { _activeBot = null; }
public void Activate(EverWingBot bot) { _activeBot = bot; }
private void AssociateRadioButtonWithBot(RadioButton radBtn, EverWingBot bot) { radBtn.Tag = bot; }