From 3fec42c6383aa3b8d65f744a93b8a918d7cc6e02 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期二, 23 七月 2024 10:15:54 +0800 Subject: [PATCH] 冲突 --- Desktop/HStation.DeskTop.Xhs.Main/Program.cs | 65 +++++++++++++++++++++++++++----- 1 files changed, 54 insertions(+), 11 deletions(-) diff --git a/Desktop/HStation.DeskTop.Xhs.Main/Program.cs b/Desktop/HStation.DeskTop.Xhs.Main/Program.cs index 3d53b4b..7bb7685 100644 --- a/Desktop/HStation.DeskTop.Xhs.Main/Program.cs +++ b/Desktop/HStation.DeskTop.Xhs.Main/Program.cs @@ -1,5 +1,5 @@ 锘縰sing DevExpress.LookAndFeel; -using HStation.DeskTop; +using DevExpress.XtraEditors.Controls; using Mapster; using System; using System.Reflection; @@ -7,13 +7,13 @@ namespace HStation.Desktop { - static class Program + internal static class Program { /// <summary> /// 搴旂敤绋嬪簭鐨勪富鍏ュ彛鐐广�� /// </summary> [STAThread] - static void Main() + private static void Main() { using (var mutex = new System.Threading.Mutex(true, Application.ProductName, out bool createNew)) { @@ -31,29 +31,40 @@ System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-Hans"); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-Hans"); - //澶勭悊鏈崟鑾风殑寮傚父 + //澶勭悊鏈崟鑾风殑寮傚父 Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); //澶勭悊UI绾跨▼寮傚父 Application.ThreadException += Application_ThreadException; - //澶勭悊闈濽I绾跨▼寮傚父 + //澶勭悊闈濽I绾跨▼寮傚父 AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; - Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); + //瀛椾綋 + var font = new System.Drawing.Font("寰蒋闆呴粦", 10); + DevExpress.XtraEditors.WindowsFormsSettings.DefaultFont = font; + DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont = font; + DevExpress.Utils.AppearanceObject.DefaultFont = font; + + DevExpress.XtraEditors.Controls.Localizer.Active = new XtraMessBoxClass(); + //zh-Hans鐣岄潰缈昏瘧 + System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-Hans"); + System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-Hans"); + + //鐨偆 + DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(SkinStyle.WXICompact); + //鎵弿鍏ㄥ眬DTO鏄犲皠 TypeAdapterConfig.GlobalSettings.Scan(Assembly.Load("Yw.BLL.Auth.Core"), Assembly.Load("HStation.BLL.Xhs.Core")); - - var loginHelper = new LoginHelper(); if (!loginHelper.Login()) return; - Application.Run(new MainFrm()); + var result = HStation.Service.Organize.DbFirstHelper.Initial(out string msg); + Application.Run(new GuideMain()); } } - ///<summary> /// 杩欏氨鏄垜浠鍦ㄥ彂鐢熸湭澶勭悊寮傚父鏃跺鐞嗙殑鏂规硶锛屾垜杩欐槸鍐欏嚭閿欒缁嗕俊鎭埌鏂囨湰锛屽鍑洪敊鍚庡脊鍑轰竴涓紓浜殑鍑洪敊鎻愮ず绐椾綋锛岀粰澶у鍋氫釜鍙傝�� @@ -76,5 +87,37 @@ MessageBox.Show($"绯荤粺鍑虹幇鏈煡寮傚父锛岃閲嶅惎绯荤粺锛乗r\n{ex.Message}"); } + public class XtraMessBoxClass : Localizer + { + public override string GetLocalizedString(DevExpress.XtraEditors.Controls.StringId id) + { + switch (id) + { + case StringId.XtraMessageBoxCancelButtonText: + return "鍙栨秷"; + + case StringId.XtraMessageBoxOkButtonText: + return "纭畾"; + + case StringId.XtraMessageBoxYesButtonText: + return "鏄�"; + + case StringId.XtraMessageBoxNoButtonText: + return "鍚�"; + + case StringId.XtraMessageBoxIgnoreButtonText: + return "蹇界暐"; + + case StringId.XtraMessageBoxAbortButtonText: + return "涓"; + + case StringId.XtraMessageBoxRetryButtonText: + return "閲嶈瘯"; + + default: + return base.GetLocalizedString(id); + } + } + } } -} +} \ No newline at end of file -- Gitblit v1.9.3