Skip to content

Commit cb13985

Browse files
committed
Merge remote-tracking branch 'origin/dev' into AcronymFuzzy
2 parents 61c9797 + c54b678 commit cb13985

File tree

152 files changed

+2916
-2717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+2916
-2717
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,8 @@ migrateToAutomaticPackageRestore.ps1
300300
*.pyc
301301
*.diagsession
302302
Output-Performance.txt
303-
*.diff
303+
*.diff
304+
305+
# vscode
306+
.vscode
307+
.history
File renamed without changes.

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0-windows</TargetFramework>
55
<UseWpf>true</UseWpf>
66
<UseWindowsForms>true</UseWindowsForms>
77
<OutputType>Library</OutputType>
@@ -55,7 +55,6 @@
5555
<ItemGroup>
5656
<PackageReference Include="FSharp.Core" Version="4.7.1" />
5757
<PackageReference Include="squirrel.windows" Version="1.5.2" />
58-
<PackageReference Include="SharpZipLib" Version="1.2.0" />
5958
</ItemGroup>
6059

6160
<ItemGroup>

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
using System.Diagnostics;
44
using System.IO;
55
using System.Reflection;
6+
using System.Text.Json;
67
using System.Threading;
78
using System.Threading.Tasks;
89
using System.Windows.Forms;
9-
using Newtonsoft.Json;
1010
using Flow.Launcher.Infrastructure.Exception;
1111
using Flow.Launcher.Infrastructure.Logger;
1212
using Flow.Launcher.Plugin;
@@ -65,7 +65,7 @@ private List<Result> DeserializedResult(string output)
6565
{
6666
List<Result> results = new List<Result>();
6767

68-
JsonRPCQueryResponseModel queryResponseModel = JsonConvert.DeserializeObject<JsonRPCQueryResponseModel>(output);
68+
JsonRPCQueryResponseModel queryResponseModel = JsonSerializer.Deserialize<JsonRPCQueryResponseModel>(output);
6969
if (queryResponseModel.Result == null) return null;
7070

7171
foreach (JsonRPCResult result in queryResponseModel.Result)
@@ -84,7 +84,7 @@ private List<Result> DeserializedResult(string output)
8484
else
8585
{
8686
string actionReponse = ExecuteCallback(result1.JsonRPCAction);
87-
JsonRPCRequestModel jsonRpcRequestModel = JsonConvert.DeserializeObject<JsonRPCRequestModel>(actionReponse);
87+
JsonRPCRequestModel jsonRpcRequestModel = JsonSerializer.Deserialize<JsonRPCRequestModel>(actionReponse);
8888
if (jsonRpcRequestModel != null
8989
&& !String.IsNullOrEmpty(jsonRpcRequestModel.Method)
9090
&& jsonRpcRequestModel.Method.StartsWith("Flow.Launcher."))

Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal PluginAssemblyLoader(string assemblyFilePath)
2020
dependencyResolver = new AssemblyDependencyResolver(assemblyFilePath);
2121
assemblyName = new AssemblyName(Path.GetFileNameWithoutExtension(assemblyFilePath));
2222

23-
referencedPluginPackageDependencyResolver =
23+
referencedPluginPackageDependencyResolver =
2424
new AssemblyDependencyResolver(Path.Combine(Constant.ProgramDirectory, "Flow.Launcher.Plugin.dll"));
2525
}
2626

@@ -38,20 +38,20 @@ protected override Assembly Load(AssemblyName assemblyName)
3838
// that use Newtonsoft.Json
3939
if (assemblyPath == null || ExistsInReferencedPluginPackage(assemblyName))
4040
return null;
41-
41+
4242
return LoadFromAssemblyPath(assemblyPath);
4343
}
4444

45-
internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, Type type)
45+
internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, params Type[] types)
4646
{
4747
var allTypes = assembly.ExportedTypes;
4848

49-
return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(type));
49+
return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Intersect(types).Any());
5050
}
5151

5252
internal bool ExistsInReferencedPluginPackage(AssemblyName assemblyName)
5353
{
5454
return referencedPluginPackageDependencyResolver.ResolveAssemblyToPath(assemblyName) != null;
5555
}
5656
}
57-
}
57+
}

Flow.Launcher.Core/Plugin/PluginConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.IO;
5-
using Newtonsoft.Json;
65
using Flow.Launcher.Infrastructure;
76
using Flow.Launcher.Infrastructure.Logger;
87
using Flow.Launcher.Plugin;
8+
using System.Text.Json;
99

1010
namespace Flow.Launcher.Core.Plugin
1111
{
@@ -61,7 +61,7 @@ private static PluginMetadata GetPluginMetadata(string pluginDirectory)
6161
PluginMetadata metadata;
6262
try
6363
{
64-
metadata = JsonConvert.DeserializeObject<PluginMetadata>(File.ReadAllText(configPath));
64+
metadata = JsonSerializer.Deserialize<PluginMetadata>(File.ReadAllText(configPath));
6565
metadata.PluginDirectory = pluginDirectory;
6666
// for plugins which doesn't has ActionKeywords key
6767
metadata.ActionKeywords = metadata.ActionKeywords ?? new List<string> { metadata.ActionKeyword };

Flow.Launcher.Core/Plugin/PluginInstaller.cs

Lines changed: 0 additions & 169 deletions
This file was deleted.

0 commit comments

Comments
 (0)