using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Windows.Forms; using DevExpress.LookAndFeel; using DevExpress.Skins; using DevExpress.UserSkins; using DevExpress.XtraEditors; namespace XdCxRhDW.Sender { 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); }; } /// /// The main entry point for the application. /// [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()); } } }