private void SetTop(int top) { // Update private member. _top = top; // Update text box. this.txtTop.Text = top.ToString(); // Update the bot. _bot.SetTop(top); // Update and set the user settings. Properties.Settings.Default.Top = top; 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(); }