终端一体化运控平台
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

157 řádky
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. WindowLargeScreen windowLarge = new WindowLargeScreen();
  20. #region 设置显示页面与标题
  21. string TitleName = $"{type.Assembly.ManifestModule.Name.Replace(".dll", "")}";
  22. string name = type.FullName.Split('.')[2];
  23. string sbmc = string.Empty;
  24. switch (type.FullName)
  25. {
  26. case "BPASmartClient.ScreenALL.App":
  27. windowLarge.Init(TitleName, new ScreenALLControl()); windowLarge.Show();
  28. break;
  29. case "BPASmartClient.ScreenMaxWok.App":
  30. windowLarge.Init(TitleName, new ScreenMaxWokControl()); windowLarge.Show();
  31. break;
  32. case "BPASmartClient.ScreenMinWok.App":
  33. windowLarge.Init(TitleName, new ScreenMinWokControl()); windowLarge.Show();
  34. break;
  35. case "BPASmartClient.ScreenMorks.App":
  36. windowLarge.Init(TitleName, new ScreenMorksControl()); windowLarge.Show();
  37. break;
  38. case "BPASmartClient.ScreenSplitMeals.App":
  39. ScreenSplitMealsControl1 ScreenSplit = new ScreenSplitMealsControl1();
  40. windowLarge.Init("一号" + TitleName, ScreenSplit);
  41. WindowLargeScreen windowLarge2 = new WindowLargeScreen();
  42. windowLarge2.Init("二号" + TitleName, new ScreenSplitMealsControl2());
  43. WindowLargeScreen windowLarge3 = new WindowLargeScreen();
  44. windowLarge3.Init("三号" + TitleName, new ScreenSplitMealsControl3());
  45. for (int i = 0; i < 3; i++)
  46. {
  47. if (i==0)
  48. {
  49. windowLarge.WindowStartupLocation = WindowStartupLocation.Manual;
  50. windowLarge.Left = i * 1920;
  51. windowLarge.Top = 0;
  52. windowLarge.Height = 1080;
  53. windowLarge.Width = 1920;
  54. windowLarge.WindowState = WindowState.Maximized;
  55. windowLarge.ResizeMode = ResizeMode.NoResize;
  56. windowLarge.WindowStyle = WindowStyle.None;
  57. windowLarge.WindowState = WindowState.Normal;
  58. windowLarge.ShowInTaskbar = false;
  59. windowLarge.Topmost = true;
  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. windowLarge2.Topmost = true;
  74. }
  75. else if (i==2)
  76. {
  77. windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual;
  78. windowLarge3.Left = i * 1920;
  79. windowLarge3.Top = 0;
  80. windowLarge3.Height = 1080;
  81. windowLarge3.Width = 1920;
  82. windowLarge3.WindowState = WindowState.Maximized;
  83. windowLarge3.ResizeMode = ResizeMode.NoResize;
  84. windowLarge3.WindowStyle = WindowStyle.None;
  85. windowLarge3.WindowState = WindowState.Normal;
  86. windowLarge3.ShowInTaskbar = false;
  87. windowLarge3.Topmost = true;
  88. }
  89. }
  90. #region 不需要代码
  91. //foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens)
  92. //{
  93. // if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["一号屏"].ToString())
  94. // {
  95. // windowLarge.WindowStartupLocation = WindowStartupLocation.Manual;
  96. // windowLarge.Left = scr.WorkingArea.Left;
  97. // windowLarge.Top = scr.WorkingArea.Top;
  98. // windowLarge.Width = scr.Bounds.Width;
  99. // windowLarge.Height = scr.Bounds.Height;
  100. // windowLarge.WindowState = WindowState.Maximized;
  101. // windowLarge.ResizeMode = ResizeMode.NoResize;
  102. // windowLarge.WindowStyle = WindowStyle.None;
  103. // windowLarge.WindowState = WindowState.Normal;
  104. // windowLarge.ShowInTaskbar = false;
  105. // windowLarge.Topmost = true;
  106. // }
  107. // else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["二号屏"].ToString())
  108. // {
  109. // windowLarge2.WindowStartupLocation = WindowStartupLocation.Manual;
  110. // windowLarge2.Left = scr.WorkingArea.Left;
  111. // windowLarge2.Top = scr.WorkingArea.Top;
  112. // windowLarge2.Width = scr.Bounds.Width;
  113. // windowLarge2.Height = scr.Bounds.Height;
  114. // windowLarge2.WindowState = WindowState.Maximized;
  115. // windowLarge2.ResizeMode = ResizeMode.NoResize;
  116. // windowLarge2.WindowStyle = WindowStyle.None;
  117. // windowLarge2.WindowState = WindowState.Normal;
  118. // windowLarge2.ShowInTaskbar = false;
  119. // windowLarge2.Topmost = true;
  120. // }
  121. // else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["三号屏"].ToString())
  122. // {
  123. // windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual;
  124. // windowLarge3.Left = scr.WorkingArea.Left;
  125. // windowLarge3.Top = scr.WorkingArea.Top;
  126. // windowLarge3.Width = scr.Bounds.Width;
  127. // windowLarge3.Height = scr.Bounds.Height;
  128. // windowLarge3.WindowState = WindowState.Maximized;
  129. // windowLarge3.ResizeMode = ResizeMode.NoResize;
  130. // windowLarge3.WindowStyle = WindowStyle.None;
  131. // windowLarge3.WindowState = WindowState.Normal;
  132. // windowLarge3.ShowInTaskbar = false;
  133. // windowLarge3.Topmost = true;
  134. // }
  135. // i++;
  136. //}
  137. #endregion
  138. windowLarge.Show(); windowLarge2.Show(); windowLarge3.Show();
  139. break;
  140. }
  141. #endregion
  142. window = windowLarge;
  143. }
  144. private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
  145. {
  146. }
  147. }
  148. }