App.xaml.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. SimulatorJetTM.CurrentTM = (JetTMType)SystemConfig.Instance.GetValue<int>($"TM.TMType");
  21. UiApplication.Instance.Initialize(new UiInstance());
  22. SimulatorSystem.Instance.Initialize();
  23. }
  24. protected override void OnExit(ExitEventArgs e)
  25. {
  26. UiApplication.Instance.Terminate();
  27. SimulatorSystem.Instance.Terminate();
  28. base.OnExit(e);
  29. }
  30. }
  31. }