示例#1
0
        //add account button
        private void addButton_Click(object sender, RoutedEventArgs e)
        {
            AddAccount ASA = new AddAccount();

            String[] newAccount = ASA.Show("lol");
            ASA.Close();
            AccountController.addAccount(newAccount[0], Cryptography.Encrypt(newAccount[1], encryptionKey), bool.Parse(newAccount[2]));
            updateAccountList();
            writeAccountData();
            listView1.SelectedIndex = 0;
        }
示例#2
0
        private void addButton_Click(object sender, RoutedEventArgs e)
        {
            AddAccount ASA = new AddAccount();

            String[] newItem = ASA.Show("lol");
            ASA.Close();
            Account[] accArray = new Account[accountsArray.Length + 1];
            for (int i = 0; i < accountsArray.Length; i++)
            {
                accArray[i] = new Account {
                    username = accountsArray[i].username, password = accountsArray[i].password
                };
            }
            accArray[accountsArray.Length] = new Account {
                username = newItem[0], password = newItem[1]
            };
            accountsArray = accArray;
            updateAccountList();
            writeAccountData();
            listView1.SelectedIndex = 0;
        }