Example #1
0
        void btnAdd_Click(object sender, EventArgs e)
        {
            ServerInfoForm form = new ServerInfoForm();

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            ListViewItem item = CreateListViewItem(form.ServerInfo);

            listView.Items.Add(item);

            Global.SystemConfig.ServerList[form.ServerInfo.Name] = form.ServerInfo;

            SaveConfig();
        }
Example #2
0
        void btnEdit_Click(object sender, EventArgs e)
        {
            if (listView.FocusedItem == null)
            {
                return;
            }

            ListViewItem focusedItem = listView.FocusedItem;
            ServerInfo   serverInfo  = (ServerInfo)focusedItem.Tag;

            ServerInfoForm form = new ServerInfoForm(serverInfo);

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            UpdateListViewItem(form.ServerInfo, focusedItem);

            Global.SystemConfig.ServerList[form.ServerInfo.Name] = form.ServerInfo;

            SaveConfig();
        }