Пример #1
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (list.SelectedItem != null)
            {
                AccountDialog dlg = new AccountDialog(true);
                dlg.AccountData = SelectedAccount;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    dlg.AccountData.Save(settings, server);
                }
            }

            UpdateList();
        }
Пример #2
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AccountDialog dlg = new AccountDialog(false);

ShowDialog:
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Account account = dlg.AccountData;

                if (!settings.ElementExists("Servers", server.Element, account.Element) ||
                    MessageBox.Show("Account \"" + account.Name + "\" already exists. Overwrite?", "Error", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    account.Save(settings, server);
                }
                else
                {
                    goto ShowDialog;
                }
            }

            UpdateList();
        }
Пример #3
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (list.SelectedItem != null)
            {
                AccountDialog dlg = new AccountDialog(true);
                dlg.AccountData = SelectedAccount;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    dlg.AccountData.Save(settings, server);
                }
            }

            UpdateList();
        }
Пример #4
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AccountDialog dlg = new AccountDialog(false);

            ShowDialog:
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Account account = dlg.AccountData;

                if (!settings.ElementExists("Servers", server.Element, account.Element) ||
                    MessageBox.Show("Account \"" + account.Name + "\" already exists. Overwrite?", "Error", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    account.Save(settings, server);
                }
                else
                {
                    goto ShowDialog;
                }
            }

            UpdateList();
        }