コード例 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            var inforow = new addedit(new Megafon(), mainList);
            var dialog  = inforow.ShowDialog(this);

            if (dialog == DialogResult.OK)
            {
                add(inforow.info);
            }
        }
コード例 #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            var id      = listView1.SelectedItems[0].Index;
            var inforow = new addedit(mainList[id], mainList);
            var dialog  = inforow.ShowDialog(this);

            if (dialog == DialogResult.OK)
            {
                mainList[id]        = inforow.info;
                listView1.Items[id] = new ListViewItem(new string[] {
                    mainList[id].PhoneNumber,
                    mainList[id].FullName,
                    mainList[id].Tariff.ToString()
                });
            }
        }