Skip to content

Commit f9750bd

Browse files
committed
feat: More info on titlebar
1 parent 23ccc83 commit f9750bd

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

WndMain.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using OpenCvSharp;
99
using OpenCvSharp.Extensions;
1010
using System.Diagnostics;
11+
using System.Runtime.InteropServices;
1112

1213
namespace OpenLuckyRandom
1314
{
@@ -38,6 +39,35 @@ public WndMain()
3839
frameThicknessNum.Value = frameThickness;
3940
cascadesComboBox.SelectedIndex = 0;
4041

42+
// 检查当前进程架构
43+
string _architecture;
44+
switch (RuntimeInformation.ProcessArchitecture)
45+
{
46+
case Architecture.X86:
47+
_architecture = "x86";
48+
break;
49+
case Architecture.X64:
50+
_architecture = "x64";
51+
break;
52+
case Architecture.Arm:
53+
_architecture = "ARM32";
54+
break;
55+
case Architecture.Arm64:
56+
_architecture = "ARM64";
57+
break;
58+
default:
59+
_architecture = "Unknown";
60+
break;
61+
}
62+
63+
// 检查是否为调试版本
64+
bool _isDebugBuild = typeof(WndMain).Assembly.GetCustomAttributes(false)
65+
.OfType<DebuggableAttribute>()
66+
.Any(da => da.IsJITTrackingEnabled || da.IsJITOptimizerDisabled);
67+
68+
// 设置窗体标题
69+
this.Text = $"OpenLuckyRandom ({_architecture}) {(_isDebugBuild ? "[Debug]" : "")}";
70+
4171
// 组件整体刷新
4272
this.Refresh();
4373
}

0 commit comments

Comments
 (0)