-
Notifications
You must be signed in to change notification settings - Fork 0
/
SensorSelectForm.cs
40 lines (36 loc) · 1.28 KB
/
SensorSelectForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace PT_Sguil
{
partial class SensorSelectForm : Form
{
public SensorSelectForm(Dictionary<string, List<string>> sensorList)
{
InitializeComponent();
foreach (KeyValuePair<string, List<string>> pair in sensorList)
{
string item = string.Format("{0} ({1})", pair.Key, string.Join(" ", pair.Value.ToArray()));
this.clbSensorList.Items.Add(item);
}
}
private void btnMonitor_Click(object sender, EventArgs e)
{
if (this.clbSensorList.CheckedItems.Count > 0)
{
foreach (string str in this.clbSensorList.CheckedItems)
{
ConfigurationSupport.monitoredSensors.Add(str.Remove(str.IndexOf(" (")));
}
base.DialogResult = DialogResult.OK;
base.Close();
}
else
{
MessageBox.Show("You must select at least one sensor to monitor.", "Missing Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}