Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }