ningshuxia
8 天以前 1519533649b43337d214523f7cd075edf237b3f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using DevExpress.Diagram.Core.Localization;
using DevExpress.Utils.Localization;
using DevExpress.XtraEditors;
 
namespace IStation.Win.Schedule
{
    internal static class Program
    {
        /// <summary>
        ///  The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //´¦Àíδ²¶»ñµÄÒì³£
            System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
 
            //´¦ÀíUIÏß³ÌÒì³£
            System.Windows.Forms.Application.ThreadException += (sender, e) =>
            {
                var ex = e.Exception;
                XtraMessageBox.Show($"ϵͳ³öÏÖδ֪Òì³££¬ÇëÖØÆôϵͳ£¡\r\n{ex.Message}");
            };
 
            //´¦Àí·ÇUIÏß³ÌÒì³£   
            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                if (e.ExceptionObject is Exception ex)
                {
                    XtraMessageBox.Show($"ϵͳ³öÏÖδ֪Òì³££¬ÇëÖØÆôϵͳ£¡\r\n{ex.Message}");
                }
            };
 
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.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;
 
 
 
            //24
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-Hans");
            DiagramControlLocalizer.QueryLocalizedString += (sender, e) =>
            {
                if (e.StringIDType == typeof(DiagramControlStringId))
                {
                    if ((DiagramControlStringId)e.StringID == DiagramControlStringId.DiagramCommand_QuickPrint) e.Value = "¿ìËÙ´òÓ¡";
                    if ((DiagramControlStringId)e.StringID == DiagramControlStringId.DiagramCommand_SetPageParameters_PageSize_Header)
                        e.Value = "Ò³ÃæÉèÖÃ";
                }
 
                if ((DiagramControlStringId)e.StringID == DiagramControlStringId.PrintPreview_BestFit) e.Value = "ÊÊÓ¦Ò³Ãæ";
            };
 
            ////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(DevExpress.LookAndFeel.SkinStyle.WXICompact);
 
            // To customize application configuration such as set high DPI settings or default font,
            // see https://aka.ms/applicationconfiguration.
            ApplicationConfiguration.Initialize();
            // System.Windows.Forms.Application.Run(new frmMain());
            System.Windows.Forms.Application.Run(new bjMain());
 
 
 
        }
 
 
 
 
    }
}