Example #1
0
        private void createMenuItem_Click(object sender, EventArgs e)
        {
            ConnectConfigForm configForm = new ConnectConfigForm(null);

            if (configForm.ShowDialog() == DialogResult.OK)
            {
                dataList.Add(configForm.ItemInfo);
                listView1.BeginUpdate();
                listView1.Items.Add(new RDMListViewItem().BindData(configForm.ItemInfo));
                listView1.EndUpdate();

                JSONUtils.Write(dataList.ToArray(), CONFIG_FILENAME);
            }
        }
Example #2
0
        private void editMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 1)
            {
                try
                {
                    RDMListViewItem listViewItem = listView1.SelectedItems[0] as RDMListViewItem;
                    AccountItem     itemData     = dataList[listViewItem.Index];

                    ConnectConfigForm configForm = new ConnectConfigForm(itemData);
                    configForm.ShowDialog();
                    if (configForm.DialogResult == DialogResult.OK)
                    {
                        listViewItem.Refresh();
                        JSONUtils.Write(dataList.ToArray(), CONFIG_FILENAME);
                    }
                }
                catch { }
            }
        }