App.xaml.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Windows;
  2. using Venus_Simulator.Instances;
  3. using MECF.Framework.UI.Core.Applications;
  4. using Venus_Core;
  5. namespace Venus_Simulator
  6. {
  7. /// <summary>
  8. /// App.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class App : Application
  11. {
  12. protected override void OnStartup(StartupEventArgs e)
  13. {
  14. base.OnStartup(e);
  15. SystemConfig.Instance.Initialize();
  16. SimulatorJetChamber.CurrentPMAChamber = (JetChamber)SystemConfig.Instance.GetValue<int>($"PMA.ChamberType");
  17. SimulatorJetChamber.CurrentPMBChamber = (JetChamber)SystemConfig.Instance.GetValue<int>($"PMB.ChamberType");
  18. SimulatorJetChamber.CurrentPMCChamber = (JetChamber)SystemConfig.Instance.GetValue<int>($"PMC.ChamberType");
  19. SimulatorJetChamber.CurrentPMDChamber = (JetChamber)SystemConfig.Instance.GetValue<int>($"PMD.ChamberType");
  20. UiApplication.Instance.Initialize(new UiInstance());
  21. SimulatorSystem.Instance.Initialize();
  22. }
  23. protected override void OnExit(ExitEventArgs e)
  24. {
  25. UiApplication.Instance.Terminate();
  26. SimulatorSystem.Instance.Terminate();
  27. base.OnExit(e);
  28. }
  29. }
  30. }