forked from Ken98045/On-Guard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddEmailDlg.cs
45 lines (40 loc) · 1.08 KB
/
AddEmailDlg.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
41
42
43
44
45
using System;
using System.Windows.Forms;
namespace SAAI
{
/// <summary>
/// A simple dialog to add email addresses to the AOI notifications dialog
/// </summary>
public partial class AddEmailDlg : Form
{
public string EmailAddress { get; set; }
public AddEmailDlg()
{
InitializeComponent();
foreach (var options in EmailAddresses.EmailAddressList)
{
emailAddressList.Items.Add(options.EmailAddress);
}
}
private void OkButton_Click(object sender, EventArgs e)
{
if (null != emailAddressList.SelectedItem)
{
EmailAddress = (string)emailAddressList.SelectedItem;
DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show("You must select an email address or press Cancel");
}
}
private void CancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void emailAddressList_MouseDoubleClick(object sender, MouseEventArgs e)
{
OkButton_Click(sender, e);
}
}
}