Exemple #1
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            EditHost editHost = new EditHost();

            if (editHost.ShowDialog() == DialogResult.OK)
            {
                ListViewItem listViewItem = new ListViewItem(new string[] { editHost.host.IP, editHost.host.Domain });
                listViewItem.Tag = editHost.host;
                listView1.Items.Add(listViewItem);
            }
        }
Exemple #2
0
 private void listView1_DoubleClick(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         EditHost editHost = new EditHost((Host)listView1.SelectedItems[0].Tag);
         if (editHost.ShowDialog() == DialogResult.OK)
         {
             ListViewItem listViewItem = new ListViewItem(new string[] { editHost.host.IP, editHost.host.Domain });
             listViewItem.Tag = editHost.host;
             listView1.Items[listView1.SelectedItems[0].Index] = listViewItem;
         }
     }
 }