From 5fbba28fa6e600237c3e1daa75ba9c57a9c264cc Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Fri, 25 Aug 2023 21:47:18 +0200 Subject: [PATCH] [Feature] Framework Self-Contained, not more necessary to install .Net 6 sdk (#277), version 1.3.3.0 --- Packaging/Packaging.wapproj | 10 ------- ...nSettingsInSystemtrayIconRightClickForm.cs | 6 +++- .../HotkeyTextboxControl/HotkeyControl.cs | 14 +++++++++ UserInterface/SettingsForm.cs | 30 ++++++++----------- Utilities/Log.cs | 1 - 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/Packaging/Packaging.wapproj b/Packaging/Packaging.wapproj index 90d7779..ce16b8d 100644 --- a/Packaging/Packaging.wapproj +++ b/Packaging/Packaging.wapproj @@ -51,13 +51,8 @@ 10.0.17763.0 en-US false - ..\SystemTrayMenu.csproj - False True - True x86|x64 - https://github.com/Hofknecht/SystemTrayMenu/releases - 0 True @@ -95,11 +90,6 @@ - - - True - - diff --git a/UserInterface/HintYouCanOpenSettingsInSystemtrayIconRightClickForm.cs b/UserInterface/HintYouCanOpenSettingsInSystemtrayIconRightClickForm.cs index ebd4088..ef0046a 100644 --- a/UserInterface/HintYouCanOpenSettingsInSystemtrayIconRightClickForm.cs +++ b/UserInterface/HintYouCanOpenSettingsInSystemtrayIconRightClickForm.cs @@ -1,4 +1,8 @@ -namespace SystemTrayMenu.UserInterface +// +// Copyright (c) PlaceholderCompany. All rights reserved. +// + +namespace SystemTrayMenu.UserInterface { using System.Windows.Forms; using SystemTrayMenu.Utilities; diff --git a/UserInterface/HotkeyTextboxControl/HotkeyControl.cs b/UserInterface/HotkeyTextboxControl/HotkeyControl.cs index 500934d..ca20347 100644 --- a/UserInterface/HotkeyTextboxControl/HotkeyControl.cs +++ b/UserInterface/HotkeyTextboxControl/HotkeyControl.cs @@ -416,6 +416,20 @@ namespace SystemTrayMenu.UserInterface.HotkeyTextboxControl return HotkeyToString(HotkeyModifiers, Hotkey); } + /// + /// Disposes of the resources used by the HotkeyControl. + /// + /// True if being called from Dispose, false otherwise. + protected override void Dispose(bool disposing) + { + if (disposing) + { + dummy.Dispose(); + } + + base.Dispose(disposing); + } + /// /// Handles some misc keys, such as Ctrl+Delete and Shift+Insert. /// diff --git a/UserInterface/SettingsForm.cs b/UserInterface/SettingsForm.cs index c37e142..d3a0fc1 100644 --- a/UserInterface/SettingsForm.cs +++ b/UserInterface/SettingsForm.cs @@ -580,23 +580,6 @@ namespace SystemTrayMenu.UserInterface textBoxColorArrowHoverBackgroundDarkMode.Text = Settings.Default.ColorArrowHoverBackgroundDarkMode; } - private void ShowHintToFindSettings(object sender, EventArgs e) - { - if (!((CheckBox)sender).Checked && - Settings.Default.ShowHintYouCanOpenSettingsInSystemtrayIconRightClick) - { - using (HintYouCanOpenSettingsInSystemtrayIconRightClickForm hintForm = new()) - { - hintForm.ShowDialog(); - Settings.Default.ShowHintYouCanOpenSettingsInSystemtrayIconRightClick = - hintForm.GetShowHintAgain(); - } - } - } - - /// - /// Gets NewHotKey. - /// public string NewHotKey { get; } = string.Empty; /// @@ -819,6 +802,18 @@ namespace SystemTrayMenu.UserInterface return useStartupTask; } + private void ShowHintToFindSettings(object sender, EventArgs e) + { + if (!((CheckBox)sender).Checked && + Settings.Default.ShowHintYouCanOpenSettingsInSystemtrayIconRightClick) + { + using HintYouCanOpenSettingsInSystemtrayIconRightClickForm hintForm = new(); + hintForm.ShowDialog(); + Settings.Default.ShowHintYouCanOpenSettingsInSystemtrayIconRightClick = + hintForm.GetShowHintAgain(); + } + } + private void SettingsForm_Load(object sender, EventArgs e) { AdjustControlMultilineIfNecessary(checkBoxStayOpenWhenFocusLost); @@ -1509,6 +1504,7 @@ namespace SystemTrayMenu.UserInterface private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e) { + textBoxHotkey?.Dispose(); settingsForm?.Dispose(); settingsForm = null; } diff --git a/Utilities/Log.cs b/Utilities/Log.cs index 2d5a998..cefeba1 100644 --- a/Utilities/Log.cs +++ b/Utilities/Log.cs @@ -167,7 +167,6 @@ namespace SystemTrayMenu.Utilities using Process p = new() { - StartInfo = new ProcessStartInfo(fileName) { FileName = fileName,