-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigData.cs
More file actions
77 lines (68 loc) · 2 KB
/
ConfigData.cs
File metadata and controls
77 lines (68 loc) · 2 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
using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
namespace SuperAutoBackup.ConfigHandlers;
public class ConfigData : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
bool _isAutoBackupEnabled = false;
[JsonPropertyName("isAutoBackupEnabled")]
public bool IsAutoBackupEnabled
{
get => _isAutoBackupEnabled;
set
{
if (_isAutoBackupEnabled == value) return;
_isAutoBackupEnabled = value;
OnPropertyChanged();
}
}
int _backupCountLimit = 10;
[JsonPropertyName("backupCountLimit")]
public int BackupCountLimit
{
get => _backupCountLimit;
set
{
if (_backupCountLimit == value) return;
_backupCountLimit = value;
OnPropertyChanged();
}
}
bool _isLogGenerationEnabled = false;
[JsonPropertyName("isLogGenerationEnabled")]
public bool IsLogGenerationEnabled
{
get => _isLogGenerationEnabled;
set
{
if (_isLogGenerationEnabled == value) return;
_isLogGenerationEnabled = value;
OnPropertyChanged();
}
}
string _backupFolderPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
"ClassIslandBackups");
[JsonPropertyName("backupFolderPath")]
public string BackupFolderPath
{
get => _backupFolderPath;
set
{
if (_backupFolderPath == value) return;
_backupFolderPath = value;
OnPropertyChanged();
}
}
[JsonIgnore]
public double BackupProgress { get; set; } = 0;
[JsonIgnore]
public bool IsBackupInProgress { get; set; } = false;
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}