|
@@ -1,21 +1,55 @@
|
|
|
using DevExpress.LookAndFeel;
|
|
|
using DevExpress.Skins;
|
|
|
using DevExpress.UserSkins;
|
|
|
+using DevExpress.XtraEditors;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Diagnostics;
|
|
|
using System.Linq;
|
|
|
+using System.Reflection;
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
namespace XdCxRhDW.DataEmulation
|
|
|
{
|
|
|
internal static class Program
|
|
|
{
|
|
|
+ static Program()
|
|
|
+ {
|
|
|
+ AppDomain.CurrentDomain.SetData("PRIVATE_BINPATH", "AddIns;");
|
|
|
+ var m = typeof(AppDomainSetup).GetMethod("UpdateContextProperty", BindingFlags.NonPublic | BindingFlags.Static);
|
|
|
+ var funsion = typeof(AppDomain).GetMethod("GetFusionContext", BindingFlags.NonPublic | BindingFlags.Instance);
|
|
|
+ m.Invoke(null, new object[] { funsion.Invoke(AppDomain.CurrentDomain, null), "PRIVATE_BINPATH", "AddIns;" });
|
|
|
+ AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
|
|
|
+ {
|
|
|
+ var args = e.ExceptionObject as Exception;
|
|
|
+ DxHelper.MsgBoxHelper.ShowError("出现未处理的异常,程序即将退出!");
|
|
|
+ };
|
|
|
+ Application.ThreadException += (sender, e) =>
|
|
|
+ {
|
|
|
+ DxHelper.MsgBoxHelper.ShowError(e.Exception.Message);
|
|
|
+ };
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// The main entry point for the application.
|
|
|
/// </summary>
|
|
|
[STAThread]
|
|
|
static void Main()
|
|
|
{
|
|
|
+ WindowsFormsSettings.AllowDpiScale = true;
|
|
|
+ WindowsFormsSettings.AllowHoverAnimation = DevExpress.Utils.DefaultBoolean.True;
|
|
|
+ WindowsFormsSettings.AllowDefaultSvgImages = DevExpress.Utils.DefaultBoolean.True;
|
|
|
+ WindowsFormsSettings.AllowRoundedWindowCorners = DevExpress.Utils.DefaultBoolean.True;
|
|
|
+ WindowsFormsSettings.AnimationMode = AnimationMode.EnableAll;
|
|
|
+ WindowsFormsSettings.BackgroundSkinningMode = BackgroundSkinningMode.AllColors;
|
|
|
+ WindowsFormsSettings.DefaultAllowHtmlDraw = true;
|
|
|
+ WindowsFormsSettings.DefaultLookAndFeel.SetSkinStyle(SkinStyle.WXICompact);
|
|
|
+ WindowsFormsSettings.DefaultFont = new System.Drawing.Font("微软雅黑", 10f);
|
|
|
+ WindowsFormsSettings.SetPerMonitorDpiAware();
|
|
|
+ if (Debugger.IsAttached)
|
|
|
+ {
|
|
|
+ //DevExpress23.2以上版本查看未本地化的资源
|
|
|
+ //DevExpress.Utils.Localization.XtraLocalizer.EnableTraceSource();
|
|
|
+ }
|
|
|
Application.EnableVisualStyles();
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
Application.Run(new Form1());
|