From 1d16b30b64924af0b51dedf4d6f7f9186e9d1984 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 15 Apr 2025 13:22:22 +0800 Subject: [PATCH] Suppress async void --- Flow.Launcher/Msg.xaml.cs | 1 + .../Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs | 4 ++++ .../SearchSourceSetting.xaml.cs | 2 ++ 3 files changed, 7 insertions(+) diff --git a/Flow.Launcher/Msg.xaml.cs b/Flow.Launcher/Msg.xaml.cs index 110235cb5..923c3692f 100644 --- a/Flow.Launcher/Msg.xaml.cs +++ b/Flow.Launcher/Msg.xaml.cs @@ -59,6 +59,7 @@ namespace Flow.Launcher Close(); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] public async void Show(string title, string subTitle, string iconPath) { tbTitle.Text = title; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs index c42bd4f30..deb110698 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs @@ -146,6 +146,7 @@ namespace Flow.Launcher.Plugin.Program.Views programSourceView.Items.Refresh(); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] private async void ReIndexing() { ViewRefresh(); @@ -183,6 +184,7 @@ namespace Flow.Launcher.Plugin.Program.Views EditProgramSource(selectedProgramSource); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] private async void EditProgramSource(ProgramSource selectedProgramSource) { if (selectedProgramSource == null) @@ -277,6 +279,7 @@ namespace Flow.Launcher.Plugin.Program.Views } } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] private async void btnLoadAllProgramSource_OnClick(object sender, RoutedEventArgs e) { await ProgramSettingDisplay.DisplayAllProgramsAsync(); @@ -284,6 +287,7 @@ namespace Flow.Launcher.Plugin.Program.Views ViewRefresh(); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] private async void btnProgramSourceStatus_OnClick(object sender, RoutedEventArgs e) { var selectedItems = programSourceView diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs index 58577dbc1..b44f130e4 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs @@ -28,6 +28,7 @@ namespace Flow.Launcher.Plugin.WebSearch Initialize(sources, context, Action.Add); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] private async void Initialize(IList sources, PluginInitContext context, Action action) { InitializeComponent(); @@ -124,6 +125,7 @@ namespace Flow.Launcher.Plugin.WebSearch } } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] private async void OnSelectIconClick(object sender, RoutedEventArgs e) { const string filter = "Image files (*.jpg, *.jpeg, *.gif, *.png, *.bmp) |*.jpg; *.jpeg; *.gif; *.png; *.bmp";