public AddAccount() { Account = new SteamAccount(); InitializeComponent(); comboBoxType.ItemsSource = Enum.GetValues(typeof(AccountType)); ComboBoxAutoStart.ItemsSource = Enum.GetValues(typeof(AutoStart)); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (Account != null) { if (string.IsNullOrEmpty(Account.Username)) { Account = null; } } }
public AddAccount(SteamAccount editAccount) { InitializeComponent(); Account = editAccount; comboBoxType.ItemsSource = Enum.GetValues(typeof(AccountType)); ComboBoxAutoStart.ItemsSource = Enum.GetValues(typeof(AutoStart)); comboBoxType.SelectedItem = editAccount.Type; ComboBoxAutoStart.SelectedItem = editAccount.AutoStart; textBoxProfilename.Text = editAccount.Name; textBoxUsername.Text = editAccount.Username; textBoxPassword.Password = editAccount.Password; }
private void buttonSave_Click(object sender, RoutedEventArgs e) { try { Account.Type = (AccountType)comboBoxType.SelectedItem; Account.AutoStart = (AutoStart)ComboBoxAutoStart.SelectedItem; Account.Name = textBoxProfilename.Text; Account.Username = textBoxUsername.Text; Account.Password = textBoxPassword.Password; } catch { Account = null; } Close(); }
public bool LoginBnet(SteamAccount b) { if (!IsSteamRunning()) { LogoutSteam(); } FileUpdateManager.Updater(); Process ahk = new Process { StartInfo = new ProcessStartInfo(@"main.ahk", b.Username + " " + b.Password) }; ahk.Start(); _recentSteamAccount = b; ScheduleHandleAutoStart(); return(true); }
private void Image_MouseUp(object sender, MouseButtonEventArgs e) { Image itemClicked = (Image)e.Source; SteamAccount selectedAcc = (SteamAccount)itemClicked.DataContext; MessageBoxResult dialogResult = MessageBox.Show("Are you sure you want to delete the '" + selectedAcc.Name + "' account?", "Delete Account", MessageBoxButton.YesNo); if (dialogResult == MessageBoxResult.Yes) { _accountList.Accounts.Remove((SteamAccount)listBoxAccounts.SelectedItem); listBoxAccounts.Items.Refresh(); } else if (dialogResult == MessageBoxResult.No) { //do something else } }
private void listBoxAccounts_MouseDoubleClick(object sender, MouseButtonEventArgs e) { SteamAccount selectedAcc = (SteamAccount)listBoxAccounts.SelectedItem; _steam.StartSteamAccount(selectedAcc); }
public bool StartSteamAccount(SteamAccount a) { LoginBnet(a); return(false); }