|
- using BPA.CustomResource.UserControls;
- using BPASmartClient.ScreenLib.炒锅;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Forms;
-
-
- namespace BPASmartClient.ScreenLib
- {
- public partial class AppMain
- {
- public AppMain(Window window, Type type)
- {
- //启动Redis数据读取
- AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
- FSystemHelper.GetInstance.CreateDesktopShortcut();
- //FSystemHelper.GetInstance.AutoStart(true);
- WindowLargeScreen windowLarge = new WindowLargeScreen();
- #region 设置显示页面与标题
- string TitleName = $"{type.Assembly.ManifestModule.Name.Replace(".dll", "")}";
- string name = type.FullName.Split('.')[2];
- string sbmc = string.Empty;
- switch (type.FullName)
- {
- case "BPASmartClient.ScreenALL.App":
- windowLarge.Init(TitleName, new ScreenALLControl()); windowLarge.Show();
- Main.GetInstance.Start();
- break;
- case "BPASmartClient.ScreenMaxWok.App":
- windowLarge.Init(TitleName, new ScreenMaxWokControl()); windowLarge.Show();
- Main.GetInstance.Start();
- break;
- case "BPASmartClient.ScreenMinWok.App":
- windowLarge.Init(TitleName, new ScreenMinWokControl()); windowLarge.Show();
- Main.GetInstance.Start();
- break;
- case "BPASmartClient.ScreenMorks.App":
- windowLarge.Init(TitleName, new ScreenMorksControl()); windowLarge.Show();
- Main.GetInstance.Start();
- break;
- case "BPASmartClient.ScreenSplitMeals.App":
- ScreenSplitMealsControl1 ScreenSplit = new ScreenSplitMealsControl1();
- windowLarge.Init("一号" + TitleName, ScreenSplit);
-
- WindowLargeScreen windowLarge2 = new WindowLargeScreen();
- windowLarge2.Init("二号" + TitleName, new ScreenSplitMealsControl2());
- WindowLargeScreen windowLarge3 = new WindowLargeScreen();
- windowLarge3.Init("三号" + TitleName, new ScreenSplitMealsControl3());
- for (int i = 0; i < 3; i++)
- {
- if (i==0)
- {
- windowLarge.WindowStartupLocation = WindowStartupLocation.Manual;
- windowLarge.Left = i * 1920;
- windowLarge.Top = 0;
- windowLarge.Height = 1080;
- windowLarge.Width = 1920;
- windowLarge.WindowState = WindowState.Maximized;
- windowLarge.ResizeMode = ResizeMode.NoResize;
- windowLarge.WindowStyle = WindowStyle.None;
- windowLarge.WindowState = WindowState.Normal;
- windowLarge.ShowInTaskbar = false;
- }
- else if (i == 1)
- {
- windowLarge2.WindowStartupLocation = WindowStartupLocation.Manual;
- windowLarge2.Left = i * 1920;
- windowLarge2.Top = 0;
- windowLarge2.Height = 1080;
- windowLarge2.Width = 1920;
- windowLarge2.WindowState = WindowState.Maximized;
- windowLarge2.ResizeMode = ResizeMode.NoResize;
- windowLarge2.WindowStyle = WindowStyle.None;
- windowLarge2.WindowState = WindowState.Normal;
- windowLarge2.ShowInTaskbar = false;
- }
- else if (i == 2)
- {
- windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual;
- windowLarge3.Left = i * 1920;
- windowLarge3.Top = 0;
- windowLarge3.Height = 1080;
- windowLarge3.Width = 1920;
- windowLarge3.WindowState = WindowState.Maximized;
- windowLarge3.ResizeMode = ResizeMode.NoResize;
- windowLarge3.WindowStyle = WindowStyle.None;
- windowLarge3.WindowState = WindowState.Normal;
- windowLarge3.ShowInTaskbar = false;
-
- }
- }
-
- Main.GetInstance.StartServer();
- #region 不需要代码
- //foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens)
- //{
- // if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["一号屏"].ToString())
- // {
- // windowLarge.WindowStartupLocation = WindowStartupLocation.Manual;
- // windowLarge.Left = scr.WorkingArea.Left;
- // windowLarge.Top = scr.WorkingArea.Top;
- // windowLarge.Width = scr.Bounds.Width;
- // windowLarge.Height = scr.Bounds.Height;
- // windowLarge.WindowState = WindowState.Maximized;
- // windowLarge.ResizeMode = ResizeMode.NoResize;
- // windowLarge.WindowStyle = WindowStyle.None;
- // windowLarge.WindowState = WindowState.Normal;
- // windowLarge.ShowInTaskbar = false;
- // windowLarge.Topmost = true;
- // }
- // else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["二号屏"].ToString())
- // {
- // windowLarge2.WindowStartupLocation = WindowStartupLocation.Manual;
- // windowLarge2.Left = scr.WorkingArea.Left;
- // windowLarge2.Top = scr.WorkingArea.Top;
- // windowLarge2.Width = scr.Bounds.Width;
- // windowLarge2.Height = scr.Bounds.Height;
- // windowLarge2.WindowState = WindowState.Maximized;
- // windowLarge2.ResizeMode = ResizeMode.NoResize;
- // windowLarge2.WindowStyle = WindowStyle.None;
- // windowLarge2.WindowState = WindowState.Normal;
- // windowLarge2.ShowInTaskbar = false;
- // windowLarge2.Topmost = true;
- // }
- // else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["三号屏"].ToString())
- // {
- // windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual;
- // windowLarge3.Left = scr.WorkingArea.Left;
- // windowLarge3.Top = scr.WorkingArea.Top;
- // windowLarge3.Width = scr.Bounds.Width;
- // windowLarge3.Height = scr.Bounds.Height;
- // windowLarge3.WindowState = WindowState.Maximized;
- // windowLarge3.ResizeMode = ResizeMode.NoResize;
- // windowLarge3.WindowStyle = WindowStyle.None;
- // windowLarge3.WindowState = WindowState.Normal;
- // windowLarge3.ShowInTaskbar = false;
- // windowLarge3.Topmost = true;
-
- // }
- // i++;
- //}
- #endregion
- windowLarge.Show();windowLarge2.Show(); windowLarge3.Show();
- Main.GetInstance.Start();
- break;
- case "BPASmartClient.MaxWokControl.App":
- windowLarge.Init(TitleName, new MaxWokMonitorControl()); windowLarge.Show();
- break;
- }
- #endregion
- window = windowLarge;
- }
-
- private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
- {
-
- }
-
- }
- }
|