1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-10-16 14:10:45 +00:00
msfs-popout-panel-manager/DomainModel/Setting/GeneralSetting.cs

58 lines
1.6 KiB
C#
Raw Normal View History

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