Beispiel #1
0
 private void bEditAcc_Click(object sender, RoutedEventArgs e)
 {
     var acc = AccManager.GetAccount(lvAccs.SelectedIndex);
     AddEditAccount dlgAcc = new AddEditAccount(acc.UserLogin,acc.UserPassword);
     dlgAcc.Owner = this;
     dlgAcc.ShowDialog();
     if (dlgAcc.Changed)
     {
         acc.UserLogin = dlgAcc.Acc;
         acc.UserPassword = dlgAcc.Pass;
         AccManager.SaveAccounts();
     }
 }
Beispiel #2
0
 private void bAddAcc_Click(object sender, RoutedEventArgs e)
 {
     AddEditAccount dlgAcc = new AddEditAccount();
     dlgAcc.Owner = this;
     dlgAcc.ShowDialog();
     if (dlgAcc.Changed)
     {
         foreach (PoeAccHandler acc in AccManager)
             if (String.Compare(acc.UserLogin, dlgAcc.Acc, true) == 0)
             {
                 AddLogEntry("Account with user name " + dlgAcc.Acc + " already exists");
                 return;
             }
         AccManager.AddAccount(dlgAcc.Acc, dlgAcc.Pass);
     }
 }