锐腾搅拌上料功能
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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Diagnostics;
using System.Reflection;
using ICSSoft.Base.Language.Tool;
using ICSSoft.Base.UserControl.MessageControl;
using DevExpress.LookAndFeel;
using DevExpress.XtraEditors;
using DevExpress.Skins;
using DevExpress.UserSkins;
using System.ComponentModel;
namespace ICSSoft.Frame.APP
{
static class Program
{
public static System.Threading.Mutex Run;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
bool noRun = false;
Run = new System.Threading.Mutex(true, Application.ProductName, out noRun);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//DevExpress.Skins.SkinManager.EnableFormSkins();
//DevExpress.UserSkins.BonusSkins.Register();
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");
//UserLookAndFeel.Default.SetSkinStyle("Skin");
//BonusSkins.Register();
//SkinManager.EnableFormSkins();
var reg=SkinManager.Default.RegisterAssembly(typeof(SelfSkin).Assembly);
SkinManager.EnableFormSkins();
UserLookAndFeel.Default.SkinName = "DevExpress Style";
if (noRun)
{
//未运行
Run.ReleaseMutex();
Application.Run(new FormICSWorkReportNew());
}
else
{
List<LangObj> langList = new List<LangObj>();
LangObj obj = new LangObj();
obj.LConvertString = "该系统已经有一个实例在运行,无法再次运行!";
obj.LParameters = new object[] { };
langList.Add(obj);
MessageDialog dialog = new MessageDialog(1, langList);
dialog.ShowDialog();
}
}
private static Process RuningInstance()
{
Process currentProcess = Process.GetCurrentProcess();
Process[] Processes = Process.GetProcessesByName(currentProcess.ProcessName);
foreach (Process process in Processes)
{
if (process.Id != currentProcess.Id)
{
if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == currentProcess.MainModule.FileName)
{
return process;
}
}
}
return null;
}
}
}