forked from ptrsuder/IEU.Winforms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.cs
More file actions
89 lines (78 loc) · 2.44 KB
/
Config.cs
File metadata and controls
89 lines (78 loc) · 2.44 KB
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
using System.Drawing;
using System.IO;
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 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);
}
}
}