Skip to content

Commit

Permalink
feat: More info on titlebar
Browse files Browse the repository at this point in the history
WhatDamon committed Nov 30, 2024
1 parent 23ccc83 commit f9750bd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions WndMain.cs
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
using OpenCvSharp;
using OpenCvSharp.Extensions;
using System.Diagnostics;
using System.Runtime.InteropServices;

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

// 检查当前进程架构
string _architecture;
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.X86:
_architecture = "x86";
break;
case Architecture.X64:
_architecture = "x64";
break;
case Architecture.Arm:
_architecture = "ARM32";
break;
case Architecture.Arm64:
_architecture = "ARM64";
break;
default:
_architecture = "Unknown";
break;
}

// 检查是否为调试版本
bool _isDebugBuild = typeof(WndMain).Assembly.GetCustomAttributes(false)
.OfType<DebuggableAttribute>()
.Any(da => da.IsJITTrackingEnabled || da.IsJITOptimizerDisabled);

// 设置窗体标题
this.Text = $"OpenLuckyRandom ({_architecture}) {(_isDebugBuild ? "[Debug]" : "")}";

// 组件整体刷新
this.Refresh();
}

0 comments on commit f9750bd

Please # to comment.