SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
RemoveExe.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.Text;
7 using System.Windows.Forms;
8 
9 namespace SeciUserInterface.Dialogs.Exes
10 {
11  public partial class RemoveExe : Form
12  {
13 
14  private String[] toRemove;
15 
16  public RemoveExe()
17  {
18  InitializeComponent();
19  }
20 
21  private void RemoveExe_Load(object sender, EventArgs e)
22  {
23  List<String> conf = new List<string>(Seci.Managers.ExecutableMgr.GetListOfExes(false));
24  List<String> comp = new List<string>(Seci.Managers.ExecutableMgr.GetListOfComponentExes());
25 
26  for (int i = 0; i < conf.Count; ++i)
27  {
28  lstProgs.Items.Add(conf[i]);
29  }
30 
31  for (int i = 0; i < comp.Count; ++i)
32  {
33  lstSubs.Items.Add(comp[i]);
34  }
35 
36  }
37 
38  private void btnRemove_Click(object sender, EventArgs e)
39  {
40  if (lstProgs.SelectedIndex != -1)
41  {
42  lstToRemove.Items.Add(lstProgs.SelectedItem);
43  lstProgs.Items.RemoveAt(lstProgs.SelectedIndex);
44  }
45  }
46 
47  private void btnUndo_Click(object sender, EventArgs e)
48  {
49  if (lstToRemove.SelectedIndex != -1)
50  {
51  lstProgs.Items.Add(lstToRemove.SelectedItem);
52  lstToRemove.Items.RemoveAt(lstToRemove.SelectedIndex);
53  }
54  }
55 
56  private void btnOK_Click(object sender, EventArgs e)
57  {
58  if (lstToRemove.Items.Count > 0)
59  {
60  //Copy the names to remove
61  toRemove = new String[lstToRemove.Items.Count];
62 
63  for (int i = 0; i < lstToRemove.Items.Count; ++i)
64  {
65  toRemove[i] = lstToRemove.Items[i].ToString();
66  }
67  }
68 
69  if (toRemove != null)
70  {
71 
72  //Remove the Progs
73  for (int i = 0; i < toRemove.GetLength(0); ++i)
74  {
75  Seci.Managers.ExecutableMgr.RemoveExecutable(toRemove[i]);
76  }
77  }
78 
79  DialogResult = DialogResult.OK;
80  Close();
81  }
82 
83 
84 
85  }
86 }
void btnOK_Click(object sender, EventArgs e)
Definition: RemoveExe.cs:56
void RemoveExe_Load(object sender, EventArgs e)
Definition: RemoveExe.cs:21
void btnUndo_Click(object sender, EventArgs e)
Definition: RemoveExe.cs:47
void btnRemove_Click(object sender, EventArgs e)
Definition: RemoveExe.cs:38