Exemplo n.º 1
0
        private void MetroButtonWowAccountDelete_Click(object sender, EventArgs e)
        {
            WoWAccount2 wowAccount = WoWAccount2.AllAccounts.FirstOrDefault(i => i.GetLogin() == textBoxWowAccountLogin.Text);

            if (wowAccount != null)
            {
                WoWAccount2.AllAccounts.Remove(wowAccount);
            }
            UpdateControls();
        }
Exemplo n.º 2
0
        private void MetroButtonWowAccountSaveUpdate_Click(object sender, EventArgs e)
        {
            WoWAccount2 wowAccount = WoWAccount2.AllAccounts.FirstOrDefault(i => i.GetLogin() == textBoxWowAccountLogin.Text);

            if (wowAccount != null)
            {
                var index = WoWAccount2.AllAccounts.IndexOf(wowAccount);
                WoWAccount2.AllAccounts[index] = new WoWAccount2()
                {
                    EncryptedLogin = WoWAccount2.GetEncryptedArray(textBoxWowAccountLogin.Text), EncryptedPassword = WoWAccount2.GetEncryptedArray(textBoxWowAccountPassword.Text)
                };
            }
            else
            {
                WoWAccount2.AllAccounts.Add(new WoWAccount2()
                {
                    EncryptedLogin = WoWAccount2.GetEncryptedArray(textBoxWowAccountLogin.Text), EncryptedPassword = WoWAccount2.GetEncryptedArray(textBoxWowAccountPassword.Text)
                });
            }
            UpdateControls();
        }