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/Orchestration/FlightSimData.cs

43 lines
1.2 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-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-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; }
public bool IsEnteredFlight { get; set; }
public new void OnPropertyChanged(string propertyName, object oldValue, object newValue)
{
if (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
base.OnPropertyChanged(propertyName, oldValue, newValue);
}
}
public void ClearData()
{
2022-08-01 23:21:42 +00:00
CurrentMsfsAircraft = null;
2022-07-23 19:23:32 +00:00
ElectricalMasterBatteryStatus = false;
IsEnteredFlight = false;
}
}
}