1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2025-02-16 16:34:28 +01:00
msfs-popout-panel-manager/DomainModel/Setting/GeneralSetting.cs

58 lines
1.6 KiB
C#
Raw Normal View History

2024-07-28 02:12:07 +02:00
using System;
using MSFSPopoutPanelManager.Shared;
2023-07-13 00:41:31 +02:00
using Newtonsoft.Json;
namespace MSFSPopoutPanelManager.DomainModel.Setting
{
public class GeneralSetting : ObservableObject
{
public GeneralSetting()
{
InitializeChildPropertyChangeBinding();
2024-07-28 02:12:07 +02:00
PropertyChanged += (_, e) =>
{
if (e.PropertyName == "UseApplicationDataPath")
{
OnApplicationDataPathUpdated?.Invoke(this, UseApplicationDataPath);
ApplicationDataPath = FileIo.GetUserDataFilePath(UseApplicationDataPath);
}
};
ApplicationDataPath = FileIo.GetUserDataFilePath(UseApplicationDataPath);
2023-07-13 00:41:31 +02:00
}
2024-02-28 03:44:21 +01:00
public bool AlwaysOnTop { get; set; } = true;
2023-07-13 00:41:31 +02:00
2024-02-28 03:44:21 +01:00
public bool AutoClose { get; set; } = true;
2023-07-13 00:41:31 +02:00
2024-02-28 03:44:21 +01:00
public bool MinimizeToTray { get; set; } = false;
2023-07-13 00:41:31 +02:00
2024-02-28 03:44:21 +01:00
public bool StartMinimized { get; set; } = false;
2023-07-13 00:41:31 +02:00
2024-02-28 03:44:21 +01:00
public bool CheckForUpdate { get; set; } = true;
2023-07-13 00:41:31 +02:00
2024-02-28 03:44:21 +01:00
public bool TurboMode { get; set; } = false;
2023-09-29 08:15:02 +02:00
2024-07-28 02:12:07 +02:00
public bool UseApplicationDataPath { get; set; } = false;
2023-07-13 00:41:31 +02:00
[JsonIgnore, IgnorePropertyChanged]
public bool AutoStart
{
2024-02-28 03:44:21 +01:00
get => AppAutoStart.CheckIsAutoStart();
2023-07-13 00:41:31 +02:00
set
{
if (value)
AppAutoStart.Activate();
else
AppAutoStart.Deactivate();
}
}
2024-07-28 02:12:07 +02:00
[JsonIgnore]
public string ApplicationDataPath { get; set; }
public event EventHandler<bool> OnApplicationDataPathUpdated;
2023-07-13 00:41:31 +02:00
}
}