-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.cs
49 lines (46 loc) · 2.25 KB
/
Settings.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
namespace rtssh
{
public static class Settings
{
#region Methods
public static void Save(string username, string host, string port, string key, string jsonPath,
bool autoConnect, string tempText, string freqText, bool separatorSpace, int displayToggle,
string refreshInterval, bool startup)
{
// Change each setting with user's value
Properties.Settings.Default["username"] = username;
Properties.Settings.Default["host"] = host;
Properties.Settings.Default["port"] = port;
Properties.Settings.Default["key"] = key;
Properties.Settings.Default["jsonPath"] = jsonPath;
Properties.Settings.Default["autoConnect"] = autoConnect;
Properties.Settings.Default["saveSettings"] = true;
Properties.Settings.Default["tempText"] = tempText;
Properties.Settings.Default["freqText"] = freqText;
Properties.Settings.Default["separatorSpace"] = separatorSpace;
Properties.Settings.Default["displayToggle"] = displayToggle;
Properties.Settings.Default["refreshInterval"] = refreshInterval;
Properties.Settings.Default["startup"] = startup;
Properties.Settings.Default.Save();
}
public static void Clear()
{
// Revert all settings back to default values
Properties.Settings.Default["Username"] = "";
Properties.Settings.Default["Host"] = "192.168.122.1";
Properties.Settings.Default["Port"] = "22";
Properties.Settings.Default["Key"] = "";
Properties.Settings.Default["jsonPath"] = "";
Properties.Settings.Default["autoConnect"] = false;
Properties.Settings.Default["saveSettings"] = false;
Properties.Settings.Default["tempText"] = "CPU";
Properties.Settings.Default["freqText"] = "";
Properties.Settings.Default["separatorSpace"] = true;
Properties.Settings.Default["displayToggle"] = 2;
Properties.Settings.Default["refreshInterval"] = "1";
Properties.Settings.Default["startup"] = false;
Properties.Settings.Default.Save();
}
#endregion
}
}