mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix (some) build warnings
CS1572 CS1573 CS0168 CS8073 CA2200 VSTHRD110 VSTHRD200 VSTHRD105 SYSLIB0013 CS8524
This commit is contained in:
parent
b079aa3b29
commit
a3197f8ee1
31 changed files with 225 additions and 68 deletions
146
.editorconfig
Normal file
146
.editorconfig
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
|
||||
###############################
|
||||
# Core EditorConfig Options #
|
||||
###############################
|
||||
# All files
|
||||
[*]
|
||||
indent_style = space
|
||||
|
||||
# XML project files
|
||||
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
|
||||
indent_size = 2
|
||||
|
||||
# XML config files
|
||||
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
|
||||
indent_size = 2
|
||||
|
||||
# Code files
|
||||
[*.{cs,csx,vb,vbx}]
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
charset = utf-8-bom
|
||||
###############################
|
||||
# .NET Coding Conventions #
|
||||
###############################
|
||||
[*.{cs,vb}]
|
||||
# Organize usings
|
||||
dotnet_sort_system_directives_first = true
|
||||
# this. preferences
|
||||
dotnet_style_qualification_for_field = false:silent
|
||||
dotnet_style_qualification_for_property = false:silent
|
||||
dotnet_style_qualification_for_method = false:silent
|
||||
dotnet_style_qualification_for_event = false:silent
|
||||
# Language keywords vs BCL types preferences
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
||||
dotnet_style_predefined_type_for_member_access = true:silent
|
||||
# Parentheses preferences
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||
# Modifier preferences
|
||||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||
dotnet_style_readonly_field = true:suggestion
|
||||
# Expression-level preferences
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
|
||||
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||
dotnet_style_prefer_auto_properties = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||
###############################
|
||||
# Naming Conventions #
|
||||
###############################
|
||||
# Style Definitions
|
||||
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||
# Use PascalCase for constant fields
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
|
||||
dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
|
||||
dotnet_naming_symbols.constant_fields.required_modifiers = const
|
||||
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||
tab_width = 2
|
||||
end_of_line = crlf
|
||||
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
|
||||
dotnet_style_prefer_compound_assignment = true:suggestion
|
||||
dotnet_diagnostic.CA1416.severity = silent
|
||||
###############################
|
||||
# C# Coding Conventions #
|
||||
###############################
|
||||
[*.cs]
|
||||
dotnet_diagnostics.VSTHRD200.severity = none # VSTHRD200: Use "Async" suffix for async methods
|
||||
dotnet_analyzer_diagnostic.VSTHRD200.severity = none # VSTHRD200: Use "Async" suffix for async methods
|
||||
# var preferences
|
||||
csharp_style_var_for_built_in_types = true:silent
|
||||
csharp_style_var_when_type_is_apparent = true:silent
|
||||
csharp_style_var_elsewhere = true:silent
|
||||
# Expression-bodied members
|
||||
csharp_style_expression_bodied_methods = false:silent
|
||||
csharp_style_expression_bodied_constructors = false:silent
|
||||
csharp_style_expression_bodied_operators = false:silent
|
||||
csharp_style_expression_bodied_properties = true:silent
|
||||
csharp_style_expression_bodied_indexers = true:silent
|
||||
csharp_style_expression_bodied_accessors = true:silent
|
||||
# Pattern matching preferences
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
# Null-checking preferences
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
# Modifier preferences
|
||||
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
|
||||
# Expression-level preferences
|
||||
csharp_prefer_braces = true:silent
|
||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
csharp_prefer_simple_default_expression = true:suggestion
|
||||
csharp_style_pattern_local_over_anonymous_function = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
###############################
|
||||
# C# Formatting Rules #
|
||||
###############################
|
||||
# New line preferences
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
# Indentation preferences
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_labels = flush_left
|
||||
# Space preferences
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = false
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
# Wrapping preferences
|
||||
csharp_preserve_single_line_statements = true
|
||||
csharp_preserve_single_line_blocks = true
|
||||
csharp_using_directive_placement = outside_namespace:silent
|
||||
csharp_prefer_simple_using_statement = true:suggestion
|
||||
csharp_style_namespace_declarations = block_scoped:silent
|
||||
csharp_style_prefer_method_group_conversion = true:silent
|
||||
csharp_style_expression_bodied_lambdas = true:silent
|
||||
csharp_style_expression_bodied_local_functions = false:silent
|
||||
###############################
|
||||
# VB Coding Conventions #
|
||||
###############################
|
||||
[*.vb]
|
||||
# Modifier preferences
|
||||
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
using Microsoft.Win32;
|
||||
using Microsoft.Win32;
|
||||
using Squirrel;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
|
@ -127,7 +127,7 @@ namespace Flow.Launcher.Core.Configuration
|
|||
|
||||
using (var portabilityUpdater = NewUpdateManager())
|
||||
{
|
||||
portabilityUpdater.CreateUninstallerRegistryEntry();
|
||||
_ = portabilityUpdater.CreateUninstallerRegistryEntry();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
@ -98,7 +98,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
+ (erroredPlugins.Count > 1 ? "plugins have " : "plugin has ")
|
||||
+ "errored and cannot be loaded:";
|
||||
|
||||
Task.Run(() =>
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
MessageBox.Show($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
|
||||
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Test")]
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Test")]
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows10.0.19041.0")]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
@ -99,7 +99,7 @@ namespace Flow.Launcher.Core.Resource
|
|||
|
||||
SetBlurForWindow();
|
||||
}
|
||||
catch (DirectoryNotFoundException e)
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
Log.Error($"|Theme.ChangeTheme|Theme <{theme}> path can't be found");
|
||||
if (theme != defaultTheme)
|
||||
|
|
@ -109,7 +109,7 @@ namespace Flow.Launcher.Core.Resource
|
|||
}
|
||||
return false;
|
||||
}
|
||||
catch (XamlParseException e)
|
||||
catch (XamlParseException)
|
||||
{
|
||||
Log.Error($"|Theme.ChangeTheme|Theme <{theme}> fail to parse");
|
||||
if (theme != defaultTheme)
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ namespace Flow.Launcher.Infrastructure.Exception
|
|||
}
|
||||
return result;
|
||||
}
|
||||
catch (System.Exception e)
|
||||
catch
|
||||
{
|
||||
return new List<string>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
@ -46,7 +46,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
ImageCache[icon] = img;
|
||||
}
|
||||
|
||||
Task.Run(() =>
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
Stopwatch.Normal("|ImageLoader.Initialize|Preload images cost", () =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,4 +2,5 @@
|
|||
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher")]
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Core")]
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Test")]
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Test")]
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows10.0.19041.0")]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using Flow.Launcher.Plugin.SharedModels;
|
||||
using Flow.Launcher.Plugin.SharedModels;
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
|
|
@ -41,7 +42,7 @@ namespace Flow.Launcher.Plugin
|
|||
/// <summary>
|
||||
/// Copy Text to clipboard
|
||||
/// </summary>
|
||||
/// <param name="Text">Text to save on clipboard</param>
|
||||
/// <param name="text">Text to save on clipboard</param>
|
||||
public void CopyToClipboard(string text);
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -163,6 +164,7 @@ namespace Flow.Launcher.Plugin
|
|||
/// Download the specific url to a cretain file path
|
||||
/// </summary>
|
||||
/// <param name="url">URL to download file</param>
|
||||
/// <param name="filePath">path to save downloaded file</param>
|
||||
/// <param name="token">place to store file</param>
|
||||
/// <returns>Task showing the progress</returns>
|
||||
Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath, CancellationToken token = default);
|
||||
|
|
@ -178,7 +180,7 @@ namespace Flow.Launcher.Plugin
|
|||
/// Remove ActionKeyword for specific plugin
|
||||
/// </summary>
|
||||
/// <param name="pluginId">ID for plugin that needs to remove action keyword</param>
|
||||
/// <param name="newActionKeyword">The actionkeyword that is supposed to be removed</param>
|
||||
/// <param name="oldActionKeyword">The actionkeyword that is supposed to be removed</param>
|
||||
void RemoveActionKeyword(string pluginId, string oldActionKeyword);
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher")]
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Core")]
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Test")]
|
||||
[assembly: InternalsVisibleTo("Flow.Launcher.Test")]
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ namespace Flow.Launcher.Plugin
|
|||
{
|
||||
Search = search;
|
||||
RawQuery = rawQuery;
|
||||
#pragma warning disable CS0618
|
||||
Terms = terms;
|
||||
#pragma warning restore CS0618
|
||||
SearchTerms = searchTerms;
|
||||
ActionKeyword = actionKeyword;
|
||||
}
|
||||
|
|
@ -98,4 +100,4 @@ namespace Flow.Launcher.Plugin
|
|||
|
||||
public override string ToString() => RawQuery;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
|||
CopyAll(subdir.FullName, temppath);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
#if DEBUG
|
||||
throw e;
|
||||
throw;
|
||||
#else
|
||||
MessageBox.Show(string.Format("Copying path {0} has failed, it will now be deleted for consistency", targetPath));
|
||||
RemoveFolderIfExists(targetPath);
|
||||
|
|
@ -80,10 +80,10 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
|||
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
#if DEBUG
|
||||
throw e;
|
||||
throw;
|
||||
#else
|
||||
MessageBox.Show(string.Format("Unable to verify folders and files between {0} and {1}", fromPath, toPath));
|
||||
return false;
|
||||
|
|
@ -99,10 +99,10 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
|||
if (Directory.Exists(path))
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
#if DEBUG
|
||||
throw e;
|
||||
throw;
|
||||
#else
|
||||
MessageBox.Show(string.Format("Not able to delete folder {0}, please go to the location and manually delete it", path));
|
||||
#endif
|
||||
|
|
@ -127,10 +127,10 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
|||
if (LocationExists(fileOrFolderPath) || FileExists(fileOrFolderPath))
|
||||
Process.Start(psi);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
#if DEBUG
|
||||
throw e;
|
||||
throw;
|
||||
#else
|
||||
MessageBox.Show(string.Format("Unable to open the path {0}, please check if it exists", fileOrFolderPath));
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
|
@ -87,7 +89,8 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
|||
/// <summary>
|
||||
/// Runs a windows command using the provided ProcessStartInfo using a custom execute command function
|
||||
/// </summary>
|
||||
/// <param name="Func startProcess">allows you to pass in a custom command execution function</param>
|
||||
/// <param name="startProcess">allows you to pass in a custom command execution function</param>
|
||||
/// <param name="info">allows you to pass in the info that will be passed to startProcess</param>
|
||||
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
|
||||
/// <exception cref="Win32Exception">Thrown when error occurs during the execution of the command </exception>
|
||||
public static void Execute(Func<ProcessStartInfo, Process> startProcess, ProcessStartInfo info)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Url",
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FFD651C7-0546-441F-BC8C-D4EE8FD01EA7}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
.gitattributes = .gitattributes
|
||||
.gitignore = .gitignore
|
||||
appveyor.yml = appveyor.yml
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ namespace Flow.Launcher.Helper
|
|||
//get current active window
|
||||
IntPtr hWnd = GetForegroundWindow();
|
||||
|
||||
if (hWnd != null && !hWnd.Equals(IntPtr.Zero))
|
||||
if (!hWnd.Equals(IntPtr.Zero))
|
||||
{
|
||||
//if current active window is NOT desktop or shell
|
||||
if (!(hWnd.Equals(HWND_DESKTOP) || hWnd.Equals(HWND_SHELL)))
|
||||
|
|
@ -98,7 +98,7 @@ namespace Flow.Launcher.Helper
|
|||
{
|
||||
IntPtr hWndDesktop = FindWindowEx(hWnd, IntPtr.Zero, "SHELLDLL_DefView", null);
|
||||
hWndDesktop = FindWindowEx(hWndDesktop, IntPtr.Zero, "SysListView32", "FolderView");
|
||||
if (hWndDesktop != null && !hWndDesktop.Equals(IntPtr.Zero))
|
||||
if (!hWndDesktop.Equals(IntPtr.Zero))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -160,4 +160,4 @@ namespace Flow.Launcher.Helper
|
|||
public int Bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace Flow.Launcher
|
|||
|
||||
public void SetHotkey(string keyStr, bool triggerValidate = true)
|
||||
{
|
||||
SetHotkey(new HotkeyModel(keyStr), triggerValidate);
|
||||
_ = SetHotkey(new HotkeyModel(keyStr), triggerValidate);
|
||||
}
|
||||
|
||||
private bool CheckHotkeyAvailability() => HotKeyMapper.CheckAvailability(CurrentHotkey);
|
||||
|
|
|
|||
|
|
@ -4,4 +4,5 @@ using System.Windows;
|
|||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None,
|
||||
ResourceDictionaryLocation.SourceAssembly
|
||||
)]
|
||||
)]
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows10.0.19041.0")]
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ using System.Runtime.CompilerServices;
|
|||
using Flow.Launcher.Infrastructure.Logger;
|
||||
using Flow.Launcher.Infrastructure.Storage;
|
||||
using System.Collections.Concurrent;
|
||||
using Flow.Launcher.Plugin.SharedCommands;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Flow.Launcher
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Flow.Launcher.Core.Plugin;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
using Flow.Launcher.Helper;
|
||||
|
|
@ -35,7 +35,6 @@ namespace Flow.Launcher
|
|||
public readonly IPublicAPI API;
|
||||
private Settings settings;
|
||||
private SettingWindowViewModel viewModel;
|
||||
private static MainViewModel mainViewModel;
|
||||
|
||||
public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
|
||||
{
|
||||
|
|
@ -264,7 +263,7 @@ namespace Flow.Launcher
|
|||
|
||||
#endregion
|
||||
|
||||
private async void OnCheckUpdates(object sender, RoutedEventArgs e)
|
||||
private void OnCheckUpdates(object sender, RoutedEventArgs e)
|
||||
{
|
||||
viewModel.UpdateApp(); // TODO: change to command
|
||||
}
|
||||
|
|
@ -384,4 +383,4 @@ namespace Flow.Launcher
|
|||
Plugins.ScrollIntoView(Plugins.SelectedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
|
@ -299,7 +299,7 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
Hide();
|
||||
|
||||
PluginManager
|
||||
_ = PluginManager
|
||||
.ReloadData()
|
||||
.ContinueWith(_ =>
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
|
|
@ -308,7 +308,7 @@ namespace Flow.Launcher.ViewModel
|
|||
InternationalizationManager.Instance.GetTranslation("success"),
|
||||
InternationalizationManager.Instance.GetTranslation("completedSuccessfully"),
|
||||
"");
|
||||
}))
|
||||
}), TaskScheduler.Default)
|
||||
.ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
|
|
@ -927,4 +927,4 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
|
|
@ -98,7 +98,7 @@ namespace Flow.Launcher.Plugin.Caculator
|
|||
Clipboard.SetDataObject(newResult);
|
||||
return true;
|
||||
}
|
||||
catch (ExternalException e)
|
||||
catch (ExternalException)
|
||||
{
|
||||
MessageBox.Show("Copy failed, please try later");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
|
@ -202,7 +202,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
{
|
||||
try
|
||||
{
|
||||
Task.Run(() => ShellCommand.RunAsDifferentUser(record.FullPath.SetProcessStartInfo()));
|
||||
_ = Task.Run(() => ShellCommand.RunAsDifferentUser(record.FullPath.SetProcessStartInfo()));
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -93,7 +93,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
Settings.ActionKeyword.IndexSearchActionKeyword => Settings.IndexSearchKeywordEnabled &&
|
||||
keyword == Settings.IndexSearchActionKeyword,
|
||||
Settings.ActionKeyword.QuickAccessActionKeyword => Settings.QuickAccessKeywordEnabled &&
|
||||
keyword == Settings.QuickAccessActionKeyword
|
||||
keyword == Settings.QuickAccessActionKeyword,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -224,4 +225,4 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
return IndexSearch.PathIsIndexed(pathToDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
|
@ -378,7 +378,7 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
Title = context.API.GetTranslation("flowlauncher_plugin_cmd_run_as_different_user"),
|
||||
Action = c =>
|
||||
{
|
||||
Task.Run(() => Execute(ShellCommand.RunAsDifferentUser, PrepareProcessStartInfo(selectedResult.Title)));
|
||||
_ = Task.Run(() => Execute(ShellCommand.RunAsDifferentUser, PrepareProcessStartInfo(selectedResult.Title)));
|
||||
return true;
|
||||
},
|
||||
IcoPath = "Images/user.png"
|
||||
|
|
@ -408,4 +408,4 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
return resultlist;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
|
@ -340,4 +340,4 @@ namespace Flow.Launcher.Plugin.Sys
|
|||
return context.API.GetTranslation("flowlauncher_plugin_sys_plugin_description");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Controls;
|
||||
|
|
@ -72,7 +72,7 @@ namespace Flow.Launcher.Plugin.Url
|
|||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch(Exception)
|
||||
{
|
||||
context.API.ShowMsg(string.Format(context.API.GetTranslation("flowlauncher_plugin_url_canot_open_url"), raw));
|
||||
return false;
|
||||
|
|
@ -124,4 +124,4 @@ namespace Flow.Launcher.Plugin.Url
|
|||
return context.API.GetTranslation("flowlauncher_plugin_url_plugin_description");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Windows.Media;
|
||||
using JetBrains.Annotations;
|
||||
using Flow.Launcher.Infrastructure.Image;
|
||||
|
|
@ -41,14 +41,14 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
{
|
||||
var webSearch = new SearchSource
|
||||
{
|
||||
Title = string.Copy(Title),
|
||||
ActionKeyword = string.Copy(ActionKeyword),
|
||||
Url = string.Copy(Url),
|
||||
Icon = string.Copy(Icon),
|
||||
Title = Title,
|
||||
ActionKeyword = ActionKeyword,
|
||||
Url = Url,
|
||||
Icon = Icon,
|
||||
CustomIcon = CustomIcon,
|
||||
Enabled = Enabled
|
||||
};
|
||||
return webSearch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
|
|||
try
|
||||
{
|
||||
const string api = "http://suggestion.baidu.com/su?json=1&wd=";
|
||||
result = await Http.GetAsync(api + Uri.EscapeUriString(query), token).ConfigureAwait(false);
|
||||
result = await Http.GetAsync(api + Uri.EscapeDataString(query), token).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception e) when (e is HttpRequestException or {InnerException: TimeoutException})
|
||||
{
|
||||
|
|
@ -59,4 +59,4 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
|
|||
return "Baidu";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
|
|||
{
|
||||
const string api = "https://api.bing.com/qsonhs.aspx?q=";
|
||||
|
||||
using var resultStream = await Http.GetStreamAsync(api + Uri.EscapeUriString(query), token).ConfigureAwait(false);
|
||||
using var resultStream = await Http.GetStreamAsync(api + Uri.EscapeDataString(query), token).ConfigureAwait(false);
|
||||
|
||||
using var json = (await JsonDocument.ParseAsync(resultStream, cancellationToken: token));
|
||||
var root = json.RootElement.GetProperty("AS");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
|
|||
{
|
||||
const string api = "https://www.google.com/complete/search?output=chrome&q=";
|
||||
|
||||
using var resultStream = await Http.GetStreamAsync(api + Uri.EscapeUriString(query)).ConfigureAwait(false);
|
||||
using var resultStream = await Http.GetStreamAsync(api + Uri.EscapeDataString(query)).ConfigureAwait(false);
|
||||
|
||||
using var json = await JsonDocument.ParseAsync(resultStream, cancellationToken: token);
|
||||
|
||||
|
|
@ -49,4 +49,4 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
|
|||
return "Google";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#if DEBUG
|
||||
|
|
@ -18,4 +18,5 @@ using System.Runtime.InteropServices;
|
|||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.0")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.0")]
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows10.0.19041.0")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue