1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 05:40:11 +00:00
msfs-popout-panel-manager/Orchestration/FlightSimData.cs

49 lines
1.4 KiB
C#
Raw Normal View History

2022-07-23 19:23:32 +00:00
using MSFSPopoutPanelManager.Shared;
using System;
using System.ComponentModel;
namespace MSFSPopoutPanelManager.Orchestration
{
public class FlightSimData : ObservableObject
{
2022-08-01 23:21:42 +00:00
public event PropertyChangedEventHandler CurrentMsfsAircraftChanged;
2022-08-13 06:14:49 +00:00
public event PropertyChangedEventHandler CurrentMsfsLiveryTitleChanged;
2022-07-23 19:23:32 +00:00
2022-08-01 23:21:42 +00:00
public string CurrentMsfsAircraft { get; set; }
2022-07-23 19:23:32 +00:00
2022-08-05 03:43:51 +00:00
public string CurrentMsfsLiveryTitle { get; set; }
2022-08-01 23:21:42 +00:00
public bool HasCurrentMsfsAircraft
2022-07-23 19:23:32 +00:00
{
2022-08-01 23:21:42 +00:00
get { return !String.IsNullOrEmpty(CurrentMsfsAircraft); }
2022-07-23 19:23:32 +00:00
}
public bool ElectricalMasterBatteryStatus { get; set; }
public bool IsSimulatorStarted { get; set; }
2022-08-19 16:03:12 +00:00
public bool IsInCockpit { get; set; }
2022-07-23 19:23:32 +00:00
public new void OnPropertyChanged(string propertyName, object oldValue, object newValue)
{
if (oldValue != newValue)
{
2022-08-13 06:14:49 +00:00
base.OnPropertyChanged(propertyName, oldValue, newValue);
2022-08-01 23:21:42 +00:00
if (propertyName == "CurrentMsfsAircraft")
CurrentMsfsAircraftChanged?.Invoke(this, null);
2022-07-23 19:23:32 +00:00
2022-08-13 06:14:49 +00:00
if (propertyName == "CurrentMsfsLiveryTitle")
CurrentMsfsLiveryTitleChanged?.Invoke(this, null);
2022-07-23 19:23:32 +00:00
}
}
public void ClearData()
{
2022-08-01 23:21:42 +00:00
CurrentMsfsAircraft = null;
2022-08-05 03:43:51 +00:00
CurrentMsfsLiveryTitle = null;
2022-07-23 19:23:32 +00:00
ElectricalMasterBatteryStatus = false;
}
}
}