forked from Ken98045/On-Guard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmailAddresses.cs
41 lines (35 loc) · 999 Bytes
/
EmailAddresses.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
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace SAAI
{
/// <summary>
/// Just a wrapper that holds a list of the available email addresses (along with the related time/dow restrictions
/// Provides a wrapper for persistence.
/// </summary>
[Serializable]
public sealed class EmailAddresses
{
public static List<EmailOptions> EmailAddressList { get; set; }
static EmailAddresses()
{
EmailAddressList = new List<EmailOptions>();
Load();
}
static public EmailOptions GetEmailOptions(string emailAddress)
{
EmailOptions opt = null;
opt = EmailAddressList.Find(x => emailAddress == x.EmailAddress);
return opt;
}
public static void Save()
{
Storage.SaveEmailAddresses(EmailAddressList);
}
public static void Load()
{
EmailAddressList = Storage.GetEmailAddresses();
}
}
}