From 556ff9702ca3e1bd49ec5c49ebd8ec02a0c30b32 Mon Sep 17 00:00:00 2001 From: Barbara Kudiess Date: Sun, 1 Mar 2020 17:22:26 -0800 Subject: [PATCH] Wox peoject in .net Core --- Wox.Core/Wox.Core.csproj | 110 +--- Wox.Infrastructure/Http/Http.cs | 3 +- Wox.Infrastructure/StringMatcher.cs | 2 +- Wox.Infrastructure/UserSettings/Settings.cs | 2 +- Wox.Infrastructure/Wox.Infrastructure.csproj | 116 ++-- Wox.Plugin/PluginInitContext.cs | 2 +- Wox.Plugin/PluginMetadata.cs | 2 +- Wox.Plugin/PluginPair.cs | 4 +- Wox.Plugin/Query.cs | 10 +- Wox.Plugin/Result.cs | 4 +- Wox.Plugin/Wox.Plugin.csproj | 94 +--- Wox/Helper/SingleInstance.cs | 6 +- Wox/MainWindow.xaml | 2 +- Wox/Wox.csproj | 559 +++++-------------- 14 files changed, 247 insertions(+), 669 deletions(-) diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj index f50cd42f4..01f1117b3 100644 --- a/Wox.Core/Wox.Core.csproj +++ b/Wox.Core/Wox.Core.csproj @@ -1,21 +1,15 @@ - - - + + - Debug - AnyCPU - {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2} + netcoreapp3.1 + true + true Library Properties Wox.Core Wox.Core - v4.7.2 - 512 - ..\ - - - + true full @@ -26,6 +20,7 @@ 4 false + pdbonly true @@ -35,87 +30,40 @@ 4 false - - - - - - - - - - - - - - - Properties\SolutionAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - + + - - {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} - Wox.Infrastructure - - - {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} - Wox.Plugin - + + + - - 1.29.2 - runtime; build; native; contentfiles; analyzers; buildtransitive + all - - - 10.3.0 - - - 9.0.1 - - - 1.51.0 runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 1.5.2 - - - 4.0.0 + + + + + + - - + + + + + + + + + + \ No newline at end of file diff --git a/Wox.Infrastructure/Http/Http.cs b/Wox.Infrastructure/Http/Http.cs index 0c8597a5d..f8767e6e3 100644 --- a/Wox.Infrastructure/Http/Http.cs +++ b/Wox.Infrastructure/Http/Http.cs @@ -19,8 +19,7 @@ namespace Wox.Infrastructure.Http ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 - | SecurityProtocolType.Tls12 - | SecurityProtocolType.Ssl3; + | SecurityProtocolType.Tls12; } public static HttpProxy Proxy { private get; set; } diff --git a/Wox.Infrastructure/StringMatcher.cs b/Wox.Infrastructure/StringMatcher.cs index 442c1e9dd..2e86289cf 100644 --- a/Wox.Infrastructure/StringMatcher.cs +++ b/Wox.Infrastructure/StringMatcher.cs @@ -19,7 +19,7 @@ namespace Wox.Infrastructure _alphabet = alphabet; } - public static StringMatcher Instance { get; internal set; } + public static StringMatcher Instance { get; set; } [Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")] public static int Score(string source, string target) diff --git a/Wox.Infrastructure/UserSettings/Settings.cs b/Wox.Infrastructure/UserSettings/Settings.cs index 7714768f0..b73c5878a 100644 --- a/Wox.Infrastructure/UserSettings/Settings.cs +++ b/Wox.Infrastructure/UserSettings/Settings.cs @@ -28,7 +28,7 @@ namespace Wox.Infrastructure.UserSettings public bool ShouldUsePinyin { get; set; } = true; - internal StringMatcher.SearchPrecisionScore QuerySearchPrecision { get; private set; } = StringMatcher.SearchPrecisionScore.Regular; + public StringMatcher.SearchPrecisionScore QuerySearchPrecision { get; private set; } = StringMatcher.SearchPrecisionScore.Regular; [JsonIgnore] public string QuerySearchPrecisionString diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index 3351f1841..fc8329a55 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -1,19 +1,15 @@ - - - + + - Debug - AnyCPU + netcoreapp3.1 {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3} Library + true Properties Wox.Infrastructure Wox.Infrastructure - v4.7.2 - 512 - ..\ - + true full @@ -25,6 +21,7 @@ true false + pdbonly true @@ -35,87 +32,38 @@ false false - - - - - - - - - - - - - - Properties\SolutionAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} Wox.Plugin + - - 10.3.0 - - - 9.0.1 - - - 4.2.0 - - - 4.2.0 - - - 2016.4.23.4 - - - 4.0.0 - + + + + + + + - - - - xcopy /Y $(PkgPinyin4DotNet)\pinyindb\unicode_to_hanyu_pinyin.txt $(TargetDir)pinyindb\ - xcopy /Y $(PkgNLog_Schema)\content\NLog.xsd $(TargetDir) - - - + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + \ No newline at end of file diff --git a/Wox.Plugin/PluginInitContext.cs b/Wox.Plugin/PluginInitContext.cs index efa7d442a..ece2781e0 100644 --- a/Wox.Plugin/PluginInitContext.cs +++ b/Wox.Plugin/PluginInitContext.cs @@ -4,7 +4,7 @@ namespace Wox.Plugin { public class PluginInitContext { - public PluginMetadata CurrentPluginMetadata { get; internal set; } + public PluginMetadata CurrentPluginMetadata { get; set; } /// /// Public APIs for plugin invocation diff --git a/Wox.Plugin/PluginMetadata.cs b/Wox.Plugin/PluginMetadata.cs index 5b4feb88e..20637ee48 100644 --- a/Wox.Plugin/PluginMetadata.cs +++ b/Wox.Plugin/PluginMetadata.cs @@ -24,7 +24,7 @@ namespace Wox.Plugin public string PluginDirectory { get { return _pluginDirectory; } - internal set + set { _pluginDirectory = value; ExecuteFilePath = Path.Combine(value, ExecuteFileName); diff --git a/Wox.Plugin/PluginPair.cs b/Wox.Plugin/PluginPair.cs index f00888964..56dcde620 100644 --- a/Wox.Plugin/PluginPair.cs +++ b/Wox.Plugin/PluginPair.cs @@ -2,8 +2,8 @@ { public class PluginPair { - public IPlugin Plugin { get; internal set; } - public PluginMetadata Metadata { get; internal set; } + public IPlugin Plugin { get; set; } + public PluginMetadata Metadata { get; set; } diff --git a/Wox.Plugin/Query.cs b/Wox.Plugin/Query.cs index 07b640ab8..8288c8757 100644 --- a/Wox.Plugin/Query.cs +++ b/Wox.Plugin/Query.cs @@ -6,7 +6,7 @@ namespace Wox.Plugin { public class Query { - internal Query() { } + public Query() { } /// /// to allow unit tests for plug ins @@ -23,7 +23,7 @@ namespace Wox.Plugin /// Raw query, this includes action keyword if it has /// We didn't recommend use this property directly. You should always use Search property. /// - public string RawQuery { get; internal set; } + public string RawQuery { get; set; } /// /// Search part of a query. @@ -31,7 +31,7 @@ namespace Wox.Plugin /// Since we allow user to switch a exclusive plugin to generic plugin, /// so this property will always give you the "real" query part of the query /// - public string Search { get; internal set; } + public string Search { get; set; } /// /// The raw query splited into a string array. @@ -96,10 +96,10 @@ namespace Wox.Plugin public override string ToString() => RawQuery; [Obsolete("Use ActionKeyword, this property will be removed in v1.3.0")] - public string ActionName { get; internal set; } + public string ActionName { get; set; } [Obsolete("Use Search instead, this property will be removed in v1.3.0")] - public List ActionParameters { get; internal set; } + public List ActionParameters { get; set; } [Obsolete("Use Search instead, this method will be removed in v1.3.0")] public string GetAllRemainingParameter() => Search; diff --git a/Wox.Plugin/Result.cs b/Wox.Plugin/Result.cs index 6e0559d35..981669309 100644 --- a/Wox.Plugin/Result.cs +++ b/Wox.Plugin/Result.cs @@ -55,7 +55,7 @@ namespace Wox.Plugin /// /// Only resulsts that originQuery match with curren query will be displayed in the panel /// - internal Query OriginQuery { get; set; } + public Query OriginQuery { get; set; } /// /// Plugin directory @@ -122,6 +122,6 @@ namespace Wox.Plugin /// /// Plugin ID that generated this result /// - public string PluginID { get; internal set; } + public string PluginID { get; set; } } } \ No newline at end of file diff --git a/Wox.Plugin/Wox.Plugin.csproj b/Wox.Plugin/Wox.Plugin.csproj index ac66231f5..8171f3ed6 100644 --- a/Wox.Plugin/Wox.Plugin.csproj +++ b/Wox.Plugin/Wox.Plugin.csproj @@ -1,20 +1,15 @@ - - - + + - Debug - AnyCPU + netcoreapp3.1 {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} + true Library Properties Wox.Plugin Wox.Plugin - v4.7.2 - 512 - - - + true full @@ -26,6 +21,7 @@ AnyCPU false + pdbonly true @@ -35,75 +31,33 @@ 4 false - - - - - - - - - - - Properties\SolutionAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - 1.29.2 - runtime; build; native; contentfiles; analyzers; buildtransitive + all - - - 10.3.0 - - - 0.9.6.1 - - - 9.0.1 - - - 1.51.0 runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 4.0.0 + + + + + - - + + + + + \ No newline at end of file diff --git a/Wox/Helper/SingleInstance.cs b/Wox/Helper/SingleInstance.cs index 951e49091..3ee967d51 100644 --- a/Wox/Helper/SingleInstance.cs +++ b/Wox/Helper/SingleInstance.cs @@ -273,13 +273,15 @@ namespace Wox.Helper private static IList GetCommandLineArgs( string uniqueApplicationName ) { string[] args = null; - if (AppDomain.CurrentDomain.ActivationContext == null) + + try { // The application was not clickonce deployed, get args from standard API's args = Environment.GetCommandLineArgs(); } - else + catch (NotSupportedException) { + // The application was clickonce deployed // Clickonce deployed apps cannot recieve traditional commandline arguments // As a workaround commandline arguments can be written to a shared location before diff --git a/Wox/MainWindow.xaml b/Wox/MainWindow.xaml index d50411b83..b3e2aba25 100644 --- a/Wox/MainWindow.xaml +++ b/Wox/MainWindow.xaml @@ -14,7 +14,7 @@ AllowDrop="True" ShowInTaskbar="False" Style="{DynamicResource WindowStyle}" - Icon="Images\app.png" + Icon="Images/app.png" AllowsTransparency="True" Loaded="OnLoaded" Initialized="OnInitialized" diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 04f5eea1e..89a096299 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -1,39 +1,16 @@ - - - + + - Debug - AnyCPU - {DB90F671-D861-46BB-93A3-F1304F5BA1C5} WinExe - Properties - Wox - Wox - v4.7.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - ..\ - - false - - - 发布\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true + netcoreapp3.1 + true + true + Wox.App + Resources\app.ico + app.manifest - + + AnyCPU true full @@ -45,7 +22,8 @@ true false - + + AnyCPU pdbonly true @@ -55,401 +33,150 @@ 4 false - - Resources\app.ico - - - Wox.App - - - app.manifest - + - - - - - - - - - - - - - - - - - - - - + + - - Properties\SolutionAssemblyInfo.cs - - - - - - - ResultListBox.xaml - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - ActionKeywords.xaml - - - - - - - - - CustomQueryHotkeySetting.xaml - - - - HotkeyControl.xaml - - - Msg.xaml - - - SettingWindow.xaml - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - MSBuild:Compile - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - - Designer - MSBuild:Compile - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - MainWindow.xaml - Code - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - + + - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + PreserveNewest - - - - - {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2} - Wox.Core - - - {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} - Wox.Infrastructure - - - {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} - Wox.Plugin - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - PreserveNewest - - - + PreserveNewest - - + + PreserveNewest - - - - - - - + + PreserveNewest - + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + - - - 1.29.2 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 1.0.4 - - - 10.3.0 - - - 9.0.1 - - - 1.2.1 - - - 4.2.0 - - - 3.4.3 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 1.51.0 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 1.5.2 - - - 4.0.0 - - - - - powershell.exe -NoProfile -ExecutionPolicy Bypass -File $(SolutionDir)Scripts\post_build.ps1 $(ConfigurationName) $(SolutionDir) - - - taskkill /f /fi "IMAGENAME eq Wox.exe" - - - + + + - + + + \ No newline at end of file