2 using System.Collections.Generic;
3 using System.ComponentModel;
7 using System.Windows.Forms;
9 namespace Sample_Environment_Control_Interface.Dialogs.Config
18 InitializeComponent();
24 List<String> names = Seci.SeciInterface.Components_GetNames();
27 lstComps.Items.AddRange(names.ToArray());
34 if (lstComps.SelectedIndex != -1)
36 lstToRemove.Items.Add(lstComps.SelectedItem);
37 lstComps.Items.RemoveAt(lstComps.SelectedIndex);
43 if (lstToRemove.SelectedIndex != -1)
45 lstComps.Items.Add(lstToRemove.SelectedItem);
46 lstToRemove.Items.RemoveAt(lstToRemove.SelectedIndex);
53 if (lstToRemove.Items.Count > 0)
56 toRemove =
new String[lstToRemove.Items.Count];
58 for (
int i = 0; i < lstToRemove.Items.Count; ++i)
60 toRemove[i] = lstToRemove.Items[i].ToString();
67 for (
int i = 0; i < toRemove.GetLength(0); ++i)
69 Seci.SeciInterface.Components_Remove(toRemove[i]);
73 DialogResult = DialogResult.OK;
void btnOK_Click(object sender, EventArgs e)
void btnUndo_Click(object sender, EventArgs e)
void RemoveComponent_Load(object sender, EventArgs e)
void btnRemove_Click(object sender, EventArgs e)