-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppSettings.cs
60 lines (53 loc) · 1.63 KB
/
AppSettings.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Configuration;
namespace CmdQueue
{
using System.Collections.Generic;
using System.Collections.Specialized;
public class AppSettings : ApplicationSettingsBase
{
private static readonly object InstanceLock = new object();
private static AppSettings instance;
private AppSettings() {}
public static AppSettings Instance {
get {
lock ( InstanceLock ) {
if ( instance == null ) {
instance = new AppSettings();
}
}
return instance;
}
}
[UserScopedSetting]
[SettingsSerializeAs( SettingsSerializeAs.Binary )]
public List<Job> CurrentQueue {
get {
try {
if ( this["CurrentQueue"] != null ) {
return (List<Job>)this["CurrentQueue"];
}
} catch (Exception error ) { }
return null;
}
set {
this["CurrentQueue"] = value;
}
}
[UserScopedSetting]
[SettingsSerializeAs( SettingsSerializeAs.Binary )]
public StringCollection CommandHistory {
get {
try {
if ( this["CommandHistory"] != null ) {
return (StringCollection)this["CommandHistory"];
}
} catch (Exception error ) { }
return null;
}
set {
this["CommandHistory"] = value;
}
}
}
}