Beispiel #1
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (list.SelectedItem != null)
            {
                ServerDialog dlg = new ServerDialog(true);
                dlg.ServerData = SelectedServer;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    dlg.ServerData.Save(settings);
                }
            }

            UpdateList();
        }
Beispiel #2
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ServerDialog dlg = new ServerDialog(false);

ShowDialog:
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Server server = dlg.ServerData;

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

            UpdateList();
        }
Beispiel #3
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ServerDialog dlg = new ServerDialog(false);

            ShowDialog:
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Server server = dlg.ServerData;

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

            UpdateList();
        }
Beispiel #4
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (list.SelectedItem != null)
            {
                ServerDialog dlg = new ServerDialog(true);
                dlg.ServerData = SelectedServer;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    dlg.ServerData.Save(settings);
                }
            }

            UpdateList();
        }