Ejemplo n.º 1
0
        private void listBox1_MouseDoubleClick(object sender, EventArgs e)
        {
            Form2 fr2 = new Form2();

            fr2.ShowDialog();

            string name = fr2.NameOf.Trim();
            string type = fr2.Type.Trim();

            if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(type))
            {
                return;
            }
            else
            {
                listOfDevices.Items.Remove(listOfDevices.SelectedItem);
                controller.RemoveDevice(0);

                controller.AddDevice(name, type);
                listOfDevices.Items.Add(name + ", " + type);
            }
        }