终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

App.xaml.cs 2.6 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using BPASmartClient.CustomResource.Pages.Enums;
  2. using BPASmartClient.CustomResource.Pages.Model;
  3. using BPASmartClient.CustomResource.Pages.View;
  4. using BPASmartClient.Helper;
  5. using BPASmartClient.Model;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Collections.ObjectModel;
  9. using System.Configuration;
  10. using System.Data;
  11. using System.Linq;
  12. using System.Threading.Tasks;
  13. using System.Windows;
  14. using BPASmart.Server;
  15. using BPASmartClient.CustomResource.Pages.ViewModel;
  16. namespace BPASmart.DataServer
  17. {
  18. /// <summary>
  19. /// Interaction logic for App.xaml
  20. /// </summary>
  21. public partial class App : Application
  22. {
  23. public static Window MainWindow;
  24. protected override void OnStartup(StartupEventArgs e)
  25. {
  26. base.OnStartup(e);
  27. AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
  28. MenuInit();
  29. MainView mv = new MainView();
  30. mv.WindowState = WindowState.Normal;
  31. MainWindow = mv;
  32. mv.Show();
  33. BPASmart.Server.Main.GetInstance.Init();
  34. }
  35. private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
  36. {
  37. //数据服务中心异常退出后自动重启
  38. }
  39. protected override void OnExit(ExitEventArgs e)
  40. {
  41. base.OnExit(e);
  42. }
  43. private void MenuInit()
  44. {
  45. #region 消息中心
  46. ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>();
  47. InfoLog.Add(new SubMenumodel()
  48. {
  49. SubMenuName = "消息日志",
  50. AssemblyName = "BPASmartClient.CustomResource",
  51. ToggleWindowPath = "Pages.View.DebugLogView",
  52. SubMenuVisibility = Visibility.Visible,
  53. });
  54. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  55. {
  56. MainMenuIcon = "&#xe603;",
  57. MainMenuName = "消息中心",
  58. Alias = "Device Management",
  59. subMenumodels = InfoLog,
  60. });
  61. #endregion
  62. }
  63. private SubMenumodel AddSubMenuModel(string s)
  64. {
  65. return new SubMenumodel()
  66. {
  67. SubMenuName = s,
  68. AssemblyName = "BPASmart.VariableManager",
  69. ToggleWindowPath = "Views.VariableConfig",
  70. SubMenuVisibility = Visibility.Visible,
  71. };
  72. }
  73. private void DataSave()
  74. {
  75. }
  76. private void DataRead()
  77. {
  78. Json<CommunicationPar>.Read();
  79. }
  80. }
  81. }