2 using System.Collections.Generic;
3 using System.ComponentModel;
7 using System.Windows.Forms;
9 namespace Sample_Environment_Control_Interface.Dialogs.Config
15 InitializeComponent();
20 List<String> comps = Seci.SeciInterface.Components_GetNames();
21 lstComponents.Items.AddRange(comps.ToArray());
26 if (lstComponents.SelectedIndex > 0)
28 int index = lstComponents.SelectedIndex;
30 lstComponents.Items.Insert(lstComponents.SelectedIndex - 1, lstComponents.SelectedItem);
31 lstComponents.Items.RemoveAt(lstComponents.SelectedIndex);
33 lstComponents.SelectedIndex = index - 1;
39 if ((lstComponents.SelectedIndex != -1) && (lstComponents.SelectedIndex < lstComponents.Items.Count - 1))
41 int index = lstComponents.SelectedIndex;
42 lstComponents.Items.Insert(lstComponents.SelectedIndex + 2, lstComponents.SelectedItem);
43 lstComponents.Items.RemoveAt(lstComponents.SelectedIndex);
45 lstComponents.SelectedIndex = index + 1;
51 List<String> newOrder =
new List<String>();
53 for (
int i = 0; i < lstComponents.Items.Count; ++i)
55 newOrder.Add(lstComponents.Items[i].ToString());
58 Seci.SeciInterface.Components_Reorder(newOrder);
59 DialogResult = DialogResult.OK;
void ComponentOrder_Load(object sender, EventArgs e)
void btnDown_Click(object sender, EventArgs e)
void btnOK_Click(object sender, EventArgs e)
void btnUp_Click(object sender, EventArgs e)