SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
RemoveSubConfig.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 
10 namespace SeciUserInterface.Dialogs.SubConfigs
11 {
12  public partial class RemoveSubConfig : Form
13  {
14  public List<String> toRemove = new List<String>();
15 
16  public RemoveSubConfig()
17  {
18  InitializeComponent();
19  }
20 
21  private void RemoveSubConfig_Load(object sender, EventArgs e)
22  {
23  List<String> comps = Seci.Managers.ComponentMgr.GetNames();
24  foreach (String comp in comps)
25  {
26  lstProgs.Items.Add(comp);
27  }
28  }
29 
30  private void btnRemove_Click(object sender, EventArgs e)
31  {
32  if (lstProgs.SelectedIndex != -1)
33  {
34  lstToRemove.Items.Add(lstProgs.SelectedItem);
35  lstProgs.Items.RemoveAt(lstProgs.SelectedIndex);
36  }
37  }
38 
39  private void btnUndo_Click(object sender, EventArgs e)
40  {
41  if (lstToRemove.SelectedIndex != -1)
42  {
43  lstProgs.Items.Add(lstToRemove.SelectedItem);
44  lstToRemove.Items.RemoveAt(lstToRemove.SelectedIndex);
45  }
46  }
47 
48  private void btnOK_Click(object sender, EventArgs e)
49  {
50  if (lstToRemove.Items.Count > 0)
51  {
52  for (int i = 0; i < lstToRemove.Items.Count; ++i)
53  {
54  toRemove.Add(lstToRemove.Items[i].ToString());
55  }
56  }
57 
58  DialogResult = DialogResult.OK;
59  Close();
60  }
61  }
62 }
void btnRemove_Click(object sender, EventArgs e)
void RemoveSubConfig_Load(object sender, EventArgs e)
void btnUndo_Click(object sender, EventArgs e)