锐腾搅拌上料功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.6 KiB

5 months ago
5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5. using System.Diagnostics;
  6. using System.Reflection;
  7. using ICSSoft.Base.Language.Tool;
  8. using ICSSoft.Base.UserControl.MessageControl;
  9. using DevExpress.LookAndFeel;
  10. using DevExpress.XtraEditors;
  11. using DevExpress.Skins;
  12. using DevExpress.UserSkins;
  13. using System.ComponentModel;
  14. namespace ICSSoft.Frame.APP
  15. {
  16. static class Program
  17. {
  18. public static System.Threading.Mutex Run;
  19. /// <summary>
  20. /// 应用程序的主入口点。
  21. /// </summary>
  22. [STAThread]
  23. static void Main()
  24. {
  25. bool noRun = false;
  26. Run = new System.Threading.Mutex(true, Application.ProductName, out noRun);
  27. Application.EnableVisualStyles();
  28. Application.SetCompatibleTextRenderingDefault(false);
  29. //DevExpress.Skins.SkinManager.EnableFormSkins();
  30. //DevExpress.UserSkins.BonusSkins.Register();
  31. System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");
  32. //UserLookAndFeel.Default.SetSkinStyle("Skin");
  33. //BonusSkins.Register();
  34. //SkinManager.EnableFormSkins();
  35. var reg=SkinManager.Default.RegisterAssembly(typeof(SelfSkin).Assembly);
  36. SkinManager.EnableFormSkins();
  37. UserLookAndFeel.Default.SkinName = "DevExpress Style";
  38. if (noRun)
  39. {
  40. //未运行
  41. Run.ReleaseMutex();
  42. Application.Run(new FormICSWorkReportNew());
  43. }
  44. else
  45. {
  46. List<LangObj> langList = new List<LangObj>();
  47. LangObj obj = new LangObj();
  48. obj.LConvertString = "该系统已经有一个实例在运行,无法再次运行!";
  49. obj.LParameters = new object[] { };
  50. langList.Add(obj);
  51. MessageDialog dialog = new MessageDialog(1, langList);
  52. dialog.ShowDialog();
  53. }
  54. }
  55. private static Process RuningInstance()
  56. {
  57. Process currentProcess = Process.GetCurrentProcess();
  58. Process[] Processes = Process.GetProcessesByName(currentProcess.ProcessName);
  59. foreach (Process process in Processes)
  60. {
  61. if (process.Id != currentProcess.Id)
  62. {
  63. if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == currentProcess.MainModule.FileName)
  64. {
  65. return process;
  66. }
  67. }
  68. }
  69. return null;
  70. }
  71. }
  72. }