终端一体化运控平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

157 lignes
8.1 KiB

  1. using BPA.CustomResource.UserControls;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Forms;
  9. namespace BPASmartClient.ScreenLib
  10. {
  11. public partial class AppMain
  12. {
  13. public AppMain(Window window, Type type)
  14. {
  15. //启动Redis数据读取
  16. Main.GetInstance.Start();
  17. AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
  18. FSystemHelper.GetInstance.CreateDesktopShortcut();
  19. // FSystemHelper.GetInstance.AutoStart(true);
  20. WindowLargeScreen windowLarge = new WindowLargeScreen();
  21. #region 设置显示页面与标题
  22. string TitleName = $"{type.Assembly.ManifestModule.Name.Replace(".dll", "")}";
  23. string name = type.FullName.Split('.')[2];
  24. string sbmc = string.Empty;
  25. switch (type.FullName)
  26. {
  27. case "BPASmartClient.ScreenALL.App":
  28. windowLarge.Init(TitleName, new ScreenALLControl()); windowLarge.Show();
  29. break;
  30. case "BPASmartClient.ScreenMaxWok.App":
  31. windowLarge.Init(TitleName, new ScreenMaxWokControl()); windowLarge.Show();
  32. break;
  33. case "BPASmartClient.ScreenMinWok.App":
  34. windowLarge.Init(TitleName, new ScreenMinWokControl()); windowLarge.Show();
  35. break;
  36. case "BPASmartClient.ScreenMorks.App":
  37. windowLarge.Init(TitleName, new ScreenMorksControl()); windowLarge.Show();
  38. break;
  39. case "BPASmartClient.ScreenSplitMeals.App":
  40. ScreenSplitMealsControl1 ScreenSplit = new ScreenSplitMealsControl1();
  41. windowLarge.Init("一号" + TitleName, ScreenSplit);
  42. WindowLargeScreen windowLarge2 = new WindowLargeScreen();
  43. windowLarge2.Init("二号" + TitleName, new ScreenSplitMealsControl2());
  44. WindowLargeScreen windowLarge3 = new WindowLargeScreen();
  45. windowLarge3.Init("三号" + TitleName, new ScreenSplitMealsControl3());
  46. for (int i = 0; i < 3; i++)
  47. {
  48. if (i==0)
  49. {
  50. windowLarge.WindowStartupLocation = WindowStartupLocation.Manual;
  51. windowLarge.Left = i * 1920;
  52. windowLarge.Top = 0;
  53. windowLarge.Height = 1080;
  54. windowLarge.Width = 1920;
  55. windowLarge.WindowState = WindowState.Maximized;
  56. windowLarge.ResizeMode = ResizeMode.NoResize;
  57. windowLarge.WindowStyle = WindowStyle.None;
  58. windowLarge.WindowState = WindowState.Normal;
  59. windowLarge.ShowInTaskbar = false;
  60. }
  61. else if (i == 1)
  62. {
  63. windowLarge2.WindowStartupLocation = WindowStartupLocation.Manual;
  64. windowLarge2.Left = i * 1920;
  65. windowLarge2.Top = 0;
  66. windowLarge2.Height = 1080;
  67. windowLarge2.Width = 1920;
  68. windowLarge2.WindowState = WindowState.Maximized;
  69. windowLarge2.ResizeMode = ResizeMode.NoResize;
  70. windowLarge2.WindowStyle = WindowStyle.None;
  71. windowLarge2.WindowState = WindowState.Normal;
  72. windowLarge2.ShowInTaskbar = false;
  73. }
  74. else if (i == 2)
  75. {
  76. windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual;
  77. windowLarge3.Left = i * 1920;
  78. windowLarge3.Top = 0;
  79. windowLarge3.Height = 1080;
  80. windowLarge3.Width = 1920;
  81. windowLarge3.WindowState = WindowState.Maximized;
  82. windowLarge3.ResizeMode = ResizeMode.NoResize;
  83. windowLarge3.WindowStyle = WindowStyle.None;
  84. windowLarge3.WindowState = WindowState.Normal;
  85. windowLarge3.ShowInTaskbar = false;
  86. }
  87. }
  88. Main.GetInstance.StartServer();
  89. #region 不需要代码
  90. //foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens)
  91. //{
  92. // if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["一号屏"].ToString())
  93. // {
  94. // windowLarge.WindowStartupLocation = WindowStartupLocation.Manual;
  95. // windowLarge.Left = scr.WorkingArea.Left;
  96. // windowLarge.Top = scr.WorkingArea.Top;
  97. // windowLarge.Width = scr.Bounds.Width;
  98. // windowLarge.Height = scr.Bounds.Height;
  99. // windowLarge.WindowState = WindowState.Maximized;
  100. // windowLarge.ResizeMode = ResizeMode.NoResize;
  101. // windowLarge.WindowStyle = WindowStyle.None;
  102. // windowLarge.WindowState = WindowState.Normal;
  103. // windowLarge.ShowInTaskbar = false;
  104. // windowLarge.Topmost = true;
  105. // }
  106. // else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["二号屏"].ToString())
  107. // {
  108. // windowLarge2.WindowStartupLocation = WindowStartupLocation.Manual;
  109. // windowLarge2.Left = scr.WorkingArea.Left;
  110. // windowLarge2.Top = scr.WorkingArea.Top;
  111. // windowLarge2.Width = scr.Bounds.Width;
  112. // windowLarge2.Height = scr.Bounds.Height;
  113. // windowLarge2.WindowState = WindowState.Maximized;
  114. // windowLarge2.ResizeMode = ResizeMode.NoResize;
  115. // windowLarge2.WindowStyle = WindowStyle.None;
  116. // windowLarge2.WindowState = WindowState.Normal;
  117. // windowLarge2.ShowInTaskbar = false;
  118. // windowLarge2.Topmost = true;
  119. // }
  120. // else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["三号屏"].ToString())
  121. // {
  122. // windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual;
  123. // windowLarge3.Left = scr.WorkingArea.Left;
  124. // windowLarge3.Top = scr.WorkingArea.Top;
  125. // windowLarge3.Width = scr.Bounds.Width;
  126. // windowLarge3.Height = scr.Bounds.Height;
  127. // windowLarge3.WindowState = WindowState.Maximized;
  128. // windowLarge3.ResizeMode = ResizeMode.NoResize;
  129. // windowLarge3.WindowStyle = WindowStyle.None;
  130. // windowLarge3.WindowState = WindowState.Normal;
  131. // windowLarge3.ShowInTaskbar = false;
  132. // windowLarge3.Topmost = true;
  133. // }
  134. // i++;
  135. //}
  136. #endregion
  137. windowLarge.Show();windowLarge2.Show(); windowLarge3.Show();
  138. break;
  139. }
  140. #endregion
  141. window = windowLarge;
  142. }
  143. private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
  144. {
  145. }
  146. }
  147. }