using DevExpress.LookAndFeel;
|
using IStation.Client;
|
using IStation.WinFormUI;
|
using IStation.WinFormUI.Project;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace IStation.WinClient.Scatl
|
{
|
internal static class Program
|
{
|
/// <summary>
|
/// 应用程序的主入口点。
|
/// </summary>
|
[STAThread]
|
static void Main()
|
{
|
using (var mutex = new System.Threading.Mutex(true, "义维-Scada数据分析", out bool createNew))
|
{
|
if (!createNew)
|
{
|
MessageBox.Show("程序正在运行中...");
|
Application.Exit();
|
return;
|
}
|
|
#region 处理未被捕获的异常
|
|
//处理未捕获的异常
|
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
//处理UI线程异常
|
Application.ThreadException += (sender, e) =>
|
{
|
WaitFrmHelper.HideWaitForm();
|
e.Exception.ShowMessage();
|
|
};
|
//处理非UI线程异常
|
AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
|
{
|
WaitFrmHelper.HideWaitForm();
|
(e.ExceptionObject as Exception).ShowMessage();
|
};
|
|
#endregion
|
|
|
//DevExpress.UserSkins.BonusSkins.Register();
|
DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Bezier");//Visual Studio 2013 Light
|
DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(SkinSvgPalette.Bezier.OfficeColorful);
|
DevExpress.Skins.SkinManager.EnableFormSkins();
|
//zh-Hans界面翻译
|
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-Hans");
|
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-Hans");
|
Application.EnableVisualStyles();
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
//初始化雪花Id
|
SnowflakeIdHelper.SetIdGenerator(1);
|
|
var dlg = new LoadProjectOverviewDlg();
|
dlg.SetBindingData();
|
if (dlg.ShowDialog() != DialogResult.OK)
|
return;
|
|
var frm = new MainForm();
|
frm.InitialForm();
|
Application.Run(frm);
|
}
|
}
|
}
|
}
|