예제 #1
0
        private void addButton_Click(object sender, RoutedEventArgs e)
        {
            var editor = new AccountEditor();

            editor.ShowDialog();

            if (editor.EditedAccount != null)
            {
                accounts.Add(editor.EditedAccount);
                saveAccounts();
            }
        }
예제 #2
0
        private void editButton_Click(object sender, RoutedEventArgs e)
        {
            if (listBox.SelectedItem == null)
            {
                MessageBox.Show("Please select an account!", "Xenon");
                return;
            }

            var account = (Account)listBox.SelectedItem;
            var editor  = new AccountEditor(account);

            editor.ShowDialog();

            if (editor.EditedAccount != null)
            {
                accounts[accounts.IndexOf(account)] = editor.EditedAccount;
                saveAccounts();
            }
        }