-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathConfig.cs
119 lines (103 loc) · 3.35 KB
/
Config.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using Newtonsoft.Json;
using ReactiveUI;
namespace ImageEnhancingUtility.Winforms
{
[JsonObject]
public class Config : ReactiveObject
{
public Config() { }
public void ReadSettings()
{
if (!File.Exists("ieu.winforms.cfg"))
return;
var json = File.ReadAllText("ieu.winforms.cfg");
JsonConvert.PopulateObject(json, this);
}
public void SaveSettings()
{
var json = JsonConvert.SerializeObject(this);
File.WriteAllText("ieu.winforms.cfg", json);
}
private double _windowWidth = 1000;
public double WindowWidth
{
get => _windowWidth;
set => this.RaiseAndSetIfChanged(ref _windowWidth, value);
}
private double _windowHeight = 650;
public double WindowHeight
{
get => _windowHeight;
set => this.RaiseAndSetIfChanged(ref _windowHeight, value);
}
private Point _windowLocation = new Point(0,0);
public Point WindowLocation
{
get => _windowLocation;
set => this.RaiseAndSetIfChanged(ref _windowLocation, value);
}
private FormWindowState _windowState = FormWindowState.Normal;
public FormWindowState WindowState
{
get => _windowState;
set => this.RaiseAndSetIfChanged(ref _windowState, value);
}
private double _logPanelWidth = 400;
public double LogPanelWidth
{
get => _logPanelWidth;
set => this.RaiseAndSetIfChanged(ref _logPanelWidth, value);
}
private int _activeTab = 0;
public int ActiveTab
{
get => _activeTab;
set => this.RaiseAndSetIfChanged(ref _activeTab, value);
}
bool _checkForUpdates = true;
public bool CheckForUpdates
{
get => _checkForUpdates;
set => this.RaiseAndSetIfChanged(ref _checkForUpdates, value);
}
bool _windowOnTop = false;
public bool WindowOnTop
{
get => _windowOnTop;
set => this.RaiseAndSetIfChanged(ref _windowOnTop, value);
}
bool _showPopups = true;
public bool ShowPopups
{
get => _showPopups;
set => this.RaiseAndSetIfChanged(ref _showPopups, value);
}
Color _comparisonColor = Color.FromArgb(225, 0, 104);
public Color ComparisonColor
{
get => _comparisonColor;
set => this.RaiseAndSetIfChanged(ref _comparisonColor, value);
}
int _comparisonModSelectedIndex = 2;
public int ComparisonModSelectedIndex
{
get => _comparisonModSelectedIndex;
set => this.RaiseAndSetIfChanged(ref _comparisonModSelectedIndex, value);
}
bool _showPreviewSaveDialog = false;
public bool ShowPreviewSaveDialog
{
get => _showPreviewSaveDialog;
set => this.RaiseAndSetIfChanged(ref _showPreviewSaveDialog, value);
}
bool _darkTheme = true;
public bool DarkTheme
{
get => _darkTheme;
set => this.RaiseAndSetIfChanged(ref _darkTheme, value);
}
}
}