private void SetRight(int right) { // Update private member. _right = right; // Update text box. this.txtRight.Text = right.ToString(); // Update the bot. _bot.SetRight(right); // Update and set the user settings. Properties.Settings.Default.Right = right; Properties.Settings.Default.Save(); }
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(); }