1. 升级到.NET Framework 4.8

2. 增加统计触发次数选项
This commit is contained in:
2024-04-29 20:42:23 +08:00
parent dd6ddb1784
commit 86a794f83d
6 changed files with 35 additions and 22 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>

View File

@ -38,6 +38,7 @@ namespace KeyGo
this.TSMICloseToHide = new System.Windows.Forms.ToolStripMenuItem();
this.TSMIPowerBoot = new System.Windows.Forms.ToolStripMenuItem();
this.TSMIExit = new System.Windows.Forms.ToolStripMenuItem();
this.TSMITriggerCountStatistics = new System.Windows.Forms.ToolStripMenuItem();
this.TSMIConfigFile = new System.Windows.Forms.ToolStripMenuItem();
this.TSMIExportConfig = new System.Windows.Forms.ToolStripMenuItem();
this.TSMIImportConfig = new System.Windows.Forms.ToolStripMenuItem();
@ -84,11 +85,12 @@ namespace KeyGo
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.TSMIConfigFile,
this.TSMITriggerCountStatistics,
this.TSMICloseToHide,
this.TSMIPowerBoot,
this.TSMIExit});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 114);
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 136);
//
// TSMICloseToHide
//
@ -151,6 +153,12 @@ namespace KeyGo
this.TSMIPasteConfig.Size = new System.Drawing.Size(180, 22);
this.TSMIPasteConfig.Text = "从剪切板读入";
this.TSMIPasteConfig.Click += new System.EventHandler(this.TSMIPasteConfig_Click);
// TSMITriggerCountStatistics
//
this.TSMITriggerCountStatistics.Name = "TSMITriggerCountStatistics";
this.TSMITriggerCountStatistics.Size = new System.Drawing.Size(180, 22);
this.TSMITriggerCountStatistics.Text = "触发次数统计";
this.TSMITriggerCountStatistics.Click += new System.EventHandler(this.TSMITriggerCountStatistics_Click);
//
// FormMain
//
@ -190,6 +198,7 @@ namespace KeyGo
private System.Windows.Forms.ToolStripMenuItem TSMIImportConfig;
private System.Windows.Forms.ToolStripMenuItem TSMICopyConfig;
private System.Windows.Forms.ToolStripMenuItem TSMIPasteConfig;
private System.Windows.Forms.ToolStripMenuItem TSMITriggerCountStatistics;
}
}

View File

@ -305,6 +305,11 @@ namespace KeyGo
SaveAppConfig(_AppConfig);
}
private void TSMITriggerCountStatistics_Click(object sender, EventArgs e)
{
MessageBox.Show(string.Join(Environment.NewLine, _KeyGo.Items.Select(k => $"[{k.HotKey}]\t[{k.ProcessName}]\t触发了 {k.TriggerCounter} 次")), "统计结果");
}
#endregion
#region
@ -460,5 +465,6 @@ namespace KeyGo
}
#endregion
}
}

View File

@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType>
<RootNamespace>KeyGo</RootNamespace>
<AssemblyName>KeyGo</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>

View File

@ -19,7 +19,7 @@ namespace KeyGo.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {

View File

@ -1,27 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace KeyGo.Properties
{
namespace KeyGo.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}