-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.cs
More file actions
35 lines (28 loc) · 950 Bytes
/
App.cs
File metadata and controls
35 lines (28 loc) · 950 Bytes
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
using MacOSHelper.Core;
using MacOSHelper.Models;
namespace MacOSHelper;
public sealed class App
{
public MacModel? DetectedModel { get; set; }
public bool ShowDetect { get; set; }
public bool ShowCatalog { get; set; }
public string DownloadsDir { get; } =
Path.Combine(AppContext.BaseDirectory, "Downloads");
public bool IsLoading { get; set; } = true;
public string LoadingStatus { get; set; } = T.Initializing;
public float LoadingProgress { get; set; } = 0f;
public AppSettings Settings { get; }
public App()
{
Settings = AppSettings.Load();
T.Current = Settings.Language == "en" ? Lang.En : Lang.Pt;
LoadingStatus = T.Initializing;
}
public void SetLanguage(Lang lang)
{
if (T.Current == lang) return;
T.Current = lang;
Settings.Language = lang == Lang.En ? "en" : "pt";
Settings.Save();
}
}