diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index a49385a02b1..86df01a3015 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -171,8 +171,8 @@ private static async ValueTask LoadInternalAsync(string path, bool } catch (System.Exception e2) { - Log.Exception(ClassName, $"|ImageLoader.Load|Failed to get thumbnail for {path} on first try", e); - Log.Exception(ClassName, $"|ImageLoader.Load|Failed to get thumbnail for {path} on second try", e2); + Log.Exception(ClassName, $"Failed to get thumbnail for {path} on first try", e); + Log.Exception(ClassName, $"Failed to get thumbnail for {path} on second try", e2); ImageSource image = ImageCache[Constant.MissingImgIcon, false]; ImageCache[path, false] = image; diff --git a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs index b98ea50fe48..4ce0df0260d 100644 --- a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs +++ b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs @@ -12,7 +12,7 @@ namespace Flow.Launcher.Infrastructure.Image { /// - /// Subclass of + /// Subclass of /// [Flags] public enum ThumbnailOptions @@ -31,7 +31,9 @@ public class WindowsThumbnailProvider private static readonly Guid GUID_IShellItem = typeof(IShellItem).GUID; - private static readonly HRESULT S_ExtractionFailed = (HRESULT)0x8004B200; + private static readonly HRESULT S_EXTRACTIONFAILED = (HRESULT)0x8004B200; + + private static readonly HRESULT S_PATHNOTFOUND = (HRESULT)0x8004B205; public static BitmapSource GetThumbnail(string fileName, int width, int height, ThumbnailOptions options) { @@ -79,9 +81,10 @@ private static unsafe HBITMAP GetHBitmap(string fileName, int width, int height, { imageFactory.GetImage(size, (SIIGBF)options, &hBitmap); } - catch (COMException ex) when (ex.HResult == S_ExtractionFailed && options == ThumbnailOptions.ThumbnailOnly) + catch (COMException ex) when (options == ThumbnailOptions.ThumbnailOnly && + (ex.HResult == S_PATHNOTFOUND || ex.HResult == S_EXTRACTIONFAILED)) { - // Fallback to IconOnly if ThumbnailOnly fails + // Fallback to IconOnly if extraction fails or files cannot be found imageFactory.GetImage(size, (SIIGBF)ThumbnailOptions.IconOnly, &hBitmap); } catch (FileNotFoundException) when (options == ThumbnailOptions.ThumbnailOnly) @@ -89,6 +92,11 @@ private static unsafe HBITMAP GetHBitmap(string fileName, int width, int height, // Fallback to IconOnly if files cannot be found imageFactory.GetImage(size, (SIIGBF)ThumbnailOptions.IconOnly, &hBitmap); } + catch (System.Exception ex) + { + // Handle other exceptions + throw new InvalidOperationException("Failed to get thumbnail", ex); + } } finally { diff --git a/Flow.Launcher/Msg.xaml.cs b/Flow.Launcher/Msg.xaml.cs index 110235cb5ac..923c3692f8e 100644 --- a/Flow.Launcher/Msg.xaml.cs +++ b/Flow.Launcher/Msg.xaml.cs @@ -59,6 +59,7 @@ private void fadeOutStoryboard_Completed(object sender, EventArgs e) 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/Flow.Launcher/ReportWindow.xaml.cs b/Flow.Launcher/ReportWindow.xaml.cs index 0ab785a17b6..24801cf52f3 100644 --- a/Flow.Launcher/ReportWindow.xaml.cs +++ b/Flow.Launcher/ReportWindow.xaml.cs @@ -15,8 +15,6 @@ namespace Flow.Launcher { internal partial class ReportWindow { - private static readonly string ClassName = nameof(ReportWindow); - public ReportWindow(Exception exception) { InitializeComponent(); diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs index 916fd1ecee8..de7cf15c399 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs @@ -111,11 +111,11 @@ public SettingsPanePluginsViewModel(Settings settings) .ToList(); [RelayCommand] - private async Task OpenHelperAsync() + private async Task OpenHelperAsync(Button button) { var helpDialog = new ContentDialog() { - Owner = Application.Current.MainWindow, + Owner = Window.GetWindow(button), Content = new StackPanel { Children = diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml index f9f7083147b..f3d63030625 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml @@ -57,6 +57,7 @@ Height="34" Margin="0 0 20 0" Command="{Binding OpenHelperCommand}" + CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Content="" FontFamily="{DynamicResource SymbolThemeFontFamily}" FontSize="14" /> diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs index 22de4fcc082..f4c103ade01 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs @@ -1,8 +1,8 @@ -using System.Windows.Navigation; +using System.Windows.Navigation; using CommunityToolkit.Mvvm.DependencyInjection; using Flow.Launcher.SettingPages.ViewModels; -using Page = ModernWpf.Controls.Page; using Flow.Launcher.Infrastructure.UserSettings; +using Page = ModernWpf.Controls.Page; namespace Flow.Launcher.SettingPages.Views; diff --git a/Flow.Launcher/ViewModel/RelayCommand.cs b/Flow.Launcher/ViewModel/RelayCommand.cs deleted file mode 100644 index e8d4af8b526..00000000000 --- a/Flow.Launcher/ViewModel/RelayCommand.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Windows.Input; - -namespace Flow.Launcher.ViewModel -{ - public class RelayCommand : ICommand - { - private readonly Action _action; - - public RelayCommand(Action action) - { - _action = action; - } - - public virtual bool CanExecute(object parameter) - { - return true; - } - -#pragma warning disable CS0067 // the event is never used - public event EventHandler CanExecuteChanged; -#pragma warning restore CS0067 - - public virtual void Execute(object parameter) - { - _action?.Invoke(parameter); - } - } -} diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj index 54921702730..98164f48971 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj @@ -45,6 +45,7 @@ + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs index abb76580d32..58b4e86f9f9 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.Runtime.InteropServices; using System.Drawing; @@ -341,7 +341,7 @@ protected IntPtr[] GetPIDLs(DirectoryInfo[] arrFI) return null; } - IShellFolder oParentFolder = GetParentFolder(arrFI[0].Parent.FullName); + IShellFolder oParentFolder = GetParentFolder(arrFI[0].Parent!.FullName); if (null == oParentFolder) { return null; @@ -1535,7 +1535,7 @@ public void Install() m_hookType, m_filterFunc, IntPtr.Zero, - (int)AppDomain.GetCurrentThreadId()); + Environment.CurrentManagedThreadId); } // ************************************************************************ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs index 0a3a2ae43eb..72f58f5b60c 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs @@ -16,7 +16,7 @@ public static string GetTranslatedName(this SortOption sortOption) ArgumentNullException.ThrowIfNull(API); var enumName = Enum.GetName(sortOption); - var splited = enumName.Split('_'); + var splited = enumName!.Split('_'); var name = string.Join('_', splited[..^1]); var direction = splited[^1]; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs index e526fb85a1f..6c4e6a3ed8f 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs @@ -47,7 +47,7 @@ private static void LoadEnvironmentStringPaths() foreach (DictionaryEntry special in Environment.GetEnvironmentVariables()) { - var path = special.Value.ToString(); + var path = special.Value!.ToString(); // we add a trailing slash to the path to make sure drive paths become valid absolute paths. // for example, if %systemdrive% is C: we turn it to C:\ path = path.EnsureTrailingSlash(); @@ -61,7 +61,7 @@ private static void LoadEnvironmentStringPaths() { // Variables are returned with a mixture of all upper/lower case. // Call ToUpper() to make the results look consistent - _envStringPaths.Add(special.Key.ToString().ToUpper(), path); + _envStringPaths.Add(special.Key.ToString()!.ToUpper(), path); } } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs index 2f614ead80d..d4cd1348e9b 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs @@ -1,13 +1,15 @@ using System.ComponentModel; using System.Runtime.CompilerServices; +#nullable enable + namespace Flow.Launcher.Plugin.Explorer.Views { public class ActionKeywordModel : INotifyPropertyChanged { - private static Settings _settings; + private static Settings _settings = null!; - public event PropertyChangedEventHandler PropertyChanged; + public event PropertyChangedEventHandler? PropertyChanged; public static void Init(Settings settings) { @@ -54,4 +56,4 @@ public bool Enabled } } } -} \ No newline at end of file +} diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/RelayCommand.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/RelayCommand.cs deleted file mode 100644 index ff704b67979..00000000000 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/RelayCommand.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Windows.Input; - -namespace Flow.Launcher.Plugin.Explorer.ViewModels -{ - internal class RelayCommand : ICommand - { - private Action _action; - - public RelayCommand(Action action) - { - _action = action; - } - - public virtual bool CanExecute(object parameter) - { - return true; - } - - public event EventHandler CanExecuteChanged; - - public virtual void Execute(object parameter) - { - _action?.Invoke(parameter); - } - } -} diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index 4073009249b..cf9ebd33fee 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -1,9 +1,4 @@ #nullable enable -using Flow.Launcher.Plugin.Explorer.Search; -using Flow.Launcher.Plugin.Explorer.Search.Everything; -using Flow.Launcher.Plugin.Explorer.Search.Everything.Exceptions; -using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; -using Flow.Launcher.Plugin.Explorer.Views; using System; using System.Collections.Generic; using System.Diagnostics; @@ -13,11 +8,16 @@ using System.Linq; using System.Windows; using System.Windows.Forms; -using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; +using Flow.Launcher.Plugin.Explorer.Search; +using Flow.Launcher.Plugin.Explorer.Search.Everything; +using Flow.Launcher.Plugin.Explorer.Search.Everything.Exceptions; +using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; +using Flow.Launcher.Plugin.Explorer.Views; namespace Flow.Launcher.Plugin.Explorer.ViewModels { - public class SettingsViewModel : BaseModel + public partial class SettingsViewModel : BaseModel { public Settings Settings { get; set; } @@ -36,7 +36,6 @@ public SettingsViewModel(PluginInitContext context, Settings settings) InitializeActionKeywordModels(); } - public void Save() { Context.API.SaveSettingJsonStorage(); @@ -48,7 +47,6 @@ public void Save() private EnumBindingModel _selectedContentSearchEngine; private EnumBindingModel _selectedPathEnumerationEngine; - public EnumBindingModel SelectedIndexSearchEngine { get => _selectedIndexSearchEngine; @@ -261,8 +259,7 @@ private void InitializeActionKeywordModels() public ActionKeywordModel? SelectedActionKeyword { get; set; } - public ICommand EditActionKeywordCommand => new RelayCommand(EditActionKeyword); - + [RelayCommand] private void EditActionKeyword(object obj) { if (SelectedActionKeyword is not { } actionKeyword) @@ -307,12 +304,6 @@ private void EditActionKeyword(object obj) public AccessLink? SelectedQuickAccessLink { get; set; } public AccessLink? SelectedIndexSearchExcludedPath { get; set; } - - - public ICommand RemoveLinkCommand => new RelayCommand(RemoveLink); - public ICommand EditLinkCommand => new RelayCommand(EditLink); - public ICommand AddLinkCommand => new RelayCommand(AddLink); - public void AppendLink(string containerName, AccessLink link) { var container = containerName switch @@ -324,6 +315,7 @@ public void AppendLink(string containerName, AccessLink link) container.Add(link); } + [RelayCommand] private void EditLink(object commandParameter) { var (selectedLink, collection) = commandParameter switch @@ -360,7 +352,7 @@ private void ShowUnselectedMessage() Context.API.ShowMsgBox(warning); } - + [RelayCommand] private void AddLink(object commandParameter) { var container = commandParameter switch @@ -385,6 +377,7 @@ private void AddLink(object commandParameter) container.Add(newAccessLink); } + [RelayCommand] private void RemoveLink(object obj) { if (obj is not string container) return; @@ -435,7 +428,6 @@ private void RemoveLink(object obj) return path; } - internal static void OpenWindowsIndexingOptions() { var psi = new ProcessStartInfo @@ -448,39 +440,35 @@ internal static void OpenWindowsIndexingOptions() Process.Start(psi); } - private ICommand? _openFileEditorPathCommand; - - public ICommand OpenFileEditorPath => _openFileEditorPathCommand ??= new RelayCommand(_ => + [RelayCommand] + private void OpenFileEditorPath() { var path = PromptUserSelectPath(ResultType.File, Settings.EditorPath != null ? Path.GetDirectoryName(Settings.EditorPath) : null); if (path is null) return; FileEditorPath = path; - }); - - private ICommand? _openFolderEditorPathCommand; + } - public ICommand OpenFolderEditorPath => _openFolderEditorPathCommand ??= new RelayCommand(_ => + [RelayCommand] + private void OpenFolderEditorPath() { var path = PromptUserSelectPath(ResultType.File, Settings.FolderEditorPath != null ? Path.GetDirectoryName(Settings.FolderEditorPath) : null); if (path is null) return; FolderEditorPath = path; - }); - - private ICommand? _openShellPathCommand; + } - public ICommand OpenShellPath => _openShellPathCommand ??= new RelayCommand(_ => + [RelayCommand] + private void OpenShellPath() { var path = PromptUserSelectPath(ResultType.File, Settings.EditorPath != null ? Path.GetDirectoryName(Settings.EditorPath) : null); if (path is null) return; ShellPath = path; - }); - + } public string FileEditorPath { @@ -537,7 +525,6 @@ public int MaxResult } } - #region Everything FastSortWarning public Visibility FastSortWarningVisibility @@ -593,7 +580,5 @@ public string EverythingInstalledPath } #endregion - - } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs index 73c35b1c845..000b2558d14 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs @@ -85,6 +85,7 @@ private void BtnCancel_OnClick(object sender, RoutedEventArgs e) DialogResult = false; Close(); } + private void TxtCurrentActionKeyword_OnKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) @@ -94,11 +95,13 @@ private void TxtCurrentActionKeyword_OnKeyDown(object sender, KeyEventArgs e) e.Handled = true; } } + public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } + private bool SetField(ref T field, T value, [CallerMemberName] string propertyName = null) { if (EqualityComparer.Default.Equals(field, value)) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index 6ca7be84db6..e5999da4166 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -245,7 +245,7 @@ Margin="{StaticResource SettingPanelItemLeftMargin}" HorizontalAlignment="Left" VerticalAlignment="Center" - Command="{Binding OpenFileEditorPath}" + Command="{Binding OpenFileEditorPathCommand}" Content="{DynamicResource select}" /> @@ -272,7 +272,7 @@ Margin="{StaticResource SettingPanelItemLeftMargin}" HorizontalAlignment="Left" VerticalAlignment="Center" - Command="{Binding OpenFolderEditorPath}" + Command="{Binding OpenFolderEditorPathCommand}" Content="{DynamicResource select}" /> @@ -299,7 +299,7 @@ Margin="{StaticResource SettingPanelItemLeftMargin}" HorizontalAlignment="Left" VerticalAlignment="Center" - Command="{Binding OpenShellPath}" + Command="{Binding OpenShellPathCommand}" Content="{DynamicResource select}" /> diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs index b7f5efc3cc7..9203ece9ae5 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs @@ -1,11 +1,10 @@ -using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; -using Flow.Launcher.Plugin.Explorer.ViewModels; -using System.Collections.Generic; -using System.ComponentModel; +using System.ComponentModel; using System.IO; using System.Linq; using System.Windows; using System.Windows.Controls; +using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; +using Flow.Launcher.Plugin.Explorer.ViewModels; using DataFormats = System.Windows.DataFormats; using DragDropEffects = System.Windows.DragDropEffects; using DragEventArgs = System.Windows.DragEventArgs; @@ -19,9 +18,6 @@ public partial class ExplorerSettings { private readonly SettingsViewModel viewModel; - private List actionKeywordsListView; - - public ExplorerSettings(SettingsViewModel viewModel) { DataContext = viewModel; @@ -39,8 +35,6 @@ public ExplorerSettings(SettingsViewModel viewModel) lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending)); } - - private void AccessLinkDragDrop(string containerName, DragEventArgs e) { var files = (string[])e.Data.GetData(DataFormats.FileDrop); diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs index c42bd4f305d..deb110698b3 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 @@ private void ViewRefresh() programSourceView.Items.Refresh(); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] private async void ReIndexing() { ViewRefresh(); @@ -183,6 +184,7 @@ private void btnEditProgramSource_OnClick(object sender, RoutedEventArgs e) 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 @@ private void programSourceView_Drop(object sender, DragEventArgs e) } } + [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 @@ private async void btnLoadAllProgramSource_OnClick(object sender, RoutedEventArg 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.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index 043eb7a190a..39bf4965494 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -362,6 +362,7 @@ private List Commands() Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe89f"), Action = c => { + _context.API.HideMainWindow(); Application.Current.MainWindow.Close(); return true; } diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs index 58577dbc18a..b44f130e47b 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs @@ -28,6 +28,7 @@ public SearchSourceSettingWindow(IList sources, PluginInitContext 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 @@ private void EditSearchSource() } } + [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";