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

49 lines
1.4 KiB
C#
Raw Normal View History

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