Esempio n. 1
0
        private void lvSwitchRelays_OnAdd()
        {
            List <Port> ports = GetPortList();
            var         form  = new SwitchRelayForm(ports);

            if (DialogResult.OK == form.ShowDialog())
            {
                AddConnection(form.SwitchRelaySetting);
            }
        }
Esempio n. 2
0
 private void lvSwitchRelays_OnEdit()
 {
     if (lvSwitchRelays.HasSelected)
     {
         var form = new SwitchRelayForm(GetPortList())
         {
             SwitchRelaySetting = lvSwitchRelays.SelectedItems[0].Tag as SwitchRelaySetting
         };
         if (DialogResult.OK == form.ShowDialog())
         {
             lvSwitchRelays.SelectedItems[0].Tag = form.SwitchRelaySetting;
             lvSwitchRelays.SelectedItems[0].SubItems[0].Text = form.SwitchRelaySetting.name;
         }
     }
 }
 private void lvSwitchRelays_OnEdit()
 {
     if (lvSwitchRelays.HasSelected)
     {
         var form = new SwitchRelayForm(GetPortList())
         {
             SwitchRelaySetting = lvSwitchRelays.SelectedItems[0].Tag as SwitchRelaySetting
         };
         if (DialogResult.OK == form.ShowDialog())
         {
             lvSwitchRelays.SelectedItems[0].Tag = form.SwitchRelaySetting;
             lvSwitchRelays.SelectedItems[0].SubItems[0].Text = form.SwitchRelaySetting.name;
         }
     }
 }
 private void lvSwitchRelays_OnAdd()
 {
     List<Port> ports = GetPortList();
     var form = new SwitchRelayForm(ports);
     if (DialogResult.OK == form.ShowDialog())
     {
         AddConnection(form.SwitchRelaySetting);
     }
 }