SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
RemoveVI.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.VIs
10 {
11  public partial class RemoveVI : Form
12  {
13  private Seci.SerialisableList<Seci.LabView.LabViewPanelInfo> _viList;
14  public List<String> ToRemove { get; private set; }
15 
16  public RemoveVI(Seci.SerialisableList<Seci.LabView.LabViewPanelInfo> viList)
17  {
18  InitializeComponent();
19  ToRemove = new List<string>();
20 
21  _viList = viList;
22  }
23 
24  private void RemoveVI_Load(object sender, EventArgs e)
25  {
26  for (int i = 0; i < _viList.Count; ++i)
27  {
28  lstVIs.Items.Add(_viList[i].FilePath);
29  }
30  }
31 
32  private void btnRemove_Click(object sender, EventArgs e)
33  {
34  if (lstVIs.SelectedIndex != -1)
35  {
36  lstToRemove.Items.Add(lstVIs.SelectedItem);
37  lstVIs.Items.RemoveAt(lstVIs.SelectedIndex);
38  }
39  }
40 
41  private void btnUndo_Click(object sender, EventArgs e)
42  {
43  if (lstToRemove.SelectedIndex != -1)
44  {
45  lstVIs.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  for (int i = 0; i < lstToRemove.Items.Count; ++i)
56  {
57  ToRemove.Add(lstToRemove.Items[i].ToString());
58  }
59  }
60 
61  DialogResult = DialogResult.OK;
62  Close();
63  }
64  }
65 }
void btnRemove_Click(object sender, EventArgs e)
Definition: RemoveVI.cs:32
void RemoveVI_Load(object sender, EventArgs e)
Definition: RemoveVI.cs:24
void btnUndo_Click(object sender, EventArgs e)
Definition: RemoveVI.cs:41
RemoveVI(Seci.SerialisableList< Seci.LabView.LabViewPanelInfo > viList)
Definition: RemoveVI.cs:16
This class contains all the information about a LabVIEW VI that needs to be saved in the configuratio...
Seci.SerialisableList< Seci.LabView.LabViewPanelInfo > _viList
Definition: RemoveVI.cs:13
void btnOK_Click(object sender, EventArgs e)
Definition: RemoveVI.cs:50