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 Sample_Environment_Control_Interface.Dialogs.Exe
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> list = Seci.SeciInterface.Exe_GetListOfConfigExes();
24 
25  for (int i = 0; i < list.Count; ++i)
26  {
27  lstProgs.Items.Add(list[i]);
28  }
29 
30  }
31 
32  private void btnRemove_Click(object sender, EventArgs e)
33  {
34  if (lstProgs.SelectedIndex != -1)
35  {
36  lstToRemove.Items.Add(lstProgs.SelectedItem);
37  lstProgs.Items.RemoveAt(lstProgs.SelectedIndex);
38  }
39  }
40 
41  private void btnUndo_Click(object sender, EventArgs e)
42  {
43  if (lstToRemove.SelectedIndex != -1)
44  {
45  lstProgs.Items.Add(lstToRemove.SelectedItem);
46  lstToRemove.Items.RemoveAt(lstToRemove.SelectedIndex);
47  }
48  }
49 
50  private void btnOK_Click(object sender, EventArgs e)
51  {
52  if (lstToRemove.Items.Count > 0)
53  {
54  //Copy the names to remove
55  toRemove = new String[lstToRemove.Items.Count];
56 
57  for (int i = 0; i < lstToRemove.Items.Count; ++i)
58  {
59  toRemove[i] = lstToRemove.Items[i].ToString();
60  }
61  }
62 
63  if (toRemove != null)
64  {
65 
66  //Remove the Progs
67  for (int i = 0; i < toRemove.GetLength(0); ++i)
68  {
69  SECI_GUI.CurrentLayout.RemoveProgFromAllGroups(toRemove[i]);
70  Seci.SeciInterface.Exe_RemoveExecutable(toRemove[i]);
71  }
72  }
73 
74  DialogResult = DialogResult.OK;
75  Close();
76  }
77 
78 
79 
80  }
81 }
void btnUndo_Click(object sender, EventArgs e)
Definition: RemoveExe.cs:41
void btnRemove_Click(object sender, EventArgs e)
Definition: RemoveExe.cs:32
void RemoveExe_Load(object sender, EventArgs e)
Definition: RemoveExe.cs:21