Skip to content

Commit 556ff97

Browse files
committed
Wox peoject in .net Core
1 parent d329b73 commit 556ff97

File tree

14 files changed

+241
-663
lines changed

14 files changed

+241
-663
lines changed

Wox.Core/Wox.Core.csproj

Lines changed: 29 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}</ProjectGuid>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<UseWpf>true</UseWpf>
6+
<UseWindowsForms>true</UseWindowsForms>
87
<OutputType>Library</OutputType>
98
<AppDesignerFolder>Properties</AppDesignerFolder>
109
<RootNamespace>Wox.Core</RootNamespace>
1110
<AssemblyName>Wox.Core</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
15-
<TargetFrameworkProfile />
16-
<NuGetPackageImportStamp>
17-
</NuGetPackageImportStamp>
1811
</PropertyGroup>
12+
1913
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2014
<DebugSymbols>true</DebugSymbols>
2115
<DebugType>full</DebugType>
@@ -26,6 +20,7 @@
2620
<WarningLevel>4</WarningLevel>
2721
<Prefer32Bit>false</Prefer32Bit>
2822
</PropertyGroup>
23+
2924
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3025
<DebugType>pdbonly</DebugType>
3126
<Optimize>true</Optimize>
@@ -35,87 +30,40 @@
3530
<WarningLevel>4</WarningLevel>
3631
<Prefer32Bit>false</Prefer32Bit>
3732
</PropertyGroup>
38-
<ItemGroup>
39-
<Reference Include="PresentationCore" />
40-
<Reference Include="PresentationFramework" />
41-
<Reference Include="System" />
42-
<Reference Include="System.Core" />
43-
<Reference Include="System.Drawing" />
44-
<Reference Include="System.Net.Http" />
45-
<Reference Include="System.Windows.Forms" />
46-
<Reference Include="System.Xaml" />
47-
<Reference Include="System.Xml" />
48-
<Reference Include="WindowsBase" />
49-
</ItemGroup>
50-
<ItemGroup>
51-
<Compile Include="..\SolutionAssemblyInfo.cs">
52-
<Link>Properties\SolutionAssemblyInfo.cs</Link>
53-
</Compile>
54-
<Compile Include="Plugin\ExecutablePlugin.cs" />
55-
<Compile Include="Plugin\PluginsLoader.cs" />
56-
<Compile Include="Updater.cs" />
57-
<Compile Include="Resource\AvailableLanguages.cs" />
58-
<Compile Include="Resource\Internationalization.cs" />
59-
<Compile Include="Resource\InternationalizationManager.cs" />
60-
<Compile Include="Resource\Language.cs" />
61-
<Compile Include="Resource\ThemeManager.cs" />
62-
<Compile Include="Plugin\PluginInstaller.cs" />
63-
<Compile Include="Plugin\JsonRPCPlugin.cs" />
64-
<Compile Include="Plugin\JsonPRCModel.cs" />
65-
<Compile Include="Plugin\PluginConfig.cs" />
66-
<Compile Include="Plugin\PluginManager.cs" />
67-
<Compile Include="Plugin\PythonPlugin.cs" />
68-
<Compile Include="Properties\AssemblyInfo.cs" />
69-
<Compile Include="Resource\FontHelper.cs" />
70-
<Compile Include="Resource\Theme.cs" />
71-
</ItemGroup>
33+
7234
<ItemGroup>
7335
<None Include="Plugin\README.md" />
7436
<None Include="README.md" />
7537
</ItemGroup>
38+
7639
<ItemGroup>
77-
<ProjectReference Include="..\Wox.Infrastructure\Wox.Infrastructure.csproj">
78-
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
79-
<Name>Wox.Infrastructure</Name>
80-
</ProjectReference>
81-
<ProjectReference Include="..\Wox.Plugin\Wox.Plugin.csproj">
82-
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
83-
<Name>Wox.Plugin</Name>
84-
</ProjectReference>
40+
<None Remove="FodyWeavers.xml" />
8541
</ItemGroup>
42+
8643
<ItemGroup>
8744
<Content Include="FodyWeavers.xml" />
8845
</ItemGroup>
46+
8947
<ItemGroup>
90-
<PackageReference Include="Fody">
91-
<Version>1.29.2</Version>
92-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
48+
<PackageReference Include="Fody" Version="6.1.1">
9349
<PrivateAssets>all</PrivateAssets>
94-
</PackageReference>
95-
<PackageReference Include="JetBrains.Annotations">
96-
<Version>10.3.0</Version>
97-
</PackageReference>
98-
<PackageReference Include="Newtonsoft.Json">
99-
<Version>9.0.1</Version>
100-
</PackageReference>
101-
<PackageReference Include="PropertyChanged.Fody">
102-
<Version>1.51.0</Version>
10350
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
104-
<PrivateAssets>all</PrivateAssets>
105-
</PackageReference>
106-
<PackageReference Include="squirrel.windows">
107-
<Version>1.5.2</Version>
108-
</PackageReference>
109-
<PackageReference Include="System.Runtime">
110-
<Version>4.0.0</Version>
11151
</PackageReference>
52+
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
53+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
54+
<PackageReference Include="ppy.squirrel.windows" Version="1.9.0.4" />
55+
<PackageReference Include="PropertyChanged.Fody" Version="3.2.6" />
56+
<PackageReference Include="SharpZipLib" Version="1.2.0" />
57+
<PackageReference Include="System.Runtime" Version="4.3.1" />
58+
</ItemGroup>
59+
60+
<ItemGroup>
61+
<Folder Include="Properties\" />
62+
</ItemGroup>
63+
64+
<ItemGroup>
65+
<ProjectReference Include="..\Wox.Infrastructure\Wox.Infrastructure.csproj" />
66+
<ProjectReference Include="..\Wox.Plugin\Wox.Plugin.csproj" />
11267
</ItemGroup>
113-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
114-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
115-
Other similar extension points exist, see Microsoft.Common.targets.
116-
<Target Name="BeforeBuild">
117-
</Target>
118-
<Target Name="AfterBuild">
119-
</Target>
120-
-->
68+
12169
</Project>

Wox.Infrastructure/Http/Http.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ static Http()
1919
ServicePointManager.Expect100Continue = true;
2020
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls
2121
| SecurityProtocolType.Tls11
22-
| SecurityProtocolType.Tls12
23-
| SecurityProtocolType.Ssl3;
22+
| SecurityProtocolType.Tls12;
2423
}
2524

2625
public static HttpProxy Proxy { private get; set; }

Wox.Infrastructure/StringMatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public StringMatcher(IAlphabet alphabet = null)
1919
_alphabet = alphabet;
2020
}
2121

22-
public static StringMatcher Instance { get; internal set; }
22+
public static StringMatcher Instance { get; set; }
2323

2424
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
2525
public static int Score(string source, string target)

Wox.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class Settings : BaseModel
2828
public bool ShouldUsePinyin { get; set; } = true;
2929

3030

31-
internal StringMatcher.SearchPrecisionScore QuerySearchPrecision { get; private set; } = StringMatcher.SearchPrecisionScore.Regular;
31+
public StringMatcher.SearchPrecisionScore QuerySearchPrecision { get; private set; } = StringMatcher.SearchPrecisionScore.Regular;
3232

3333
[JsonIgnore]
3434
public string QuerySearchPrecisionString
Lines changed: 32 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
75
<ProjectGuid>{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}</ProjectGuid>
86
<OutputType>Library</OutputType>
7+
<UseWpf>true</UseWpf>
98
<AppDesignerFolder>Properties</AppDesignerFolder>
109
<RootNamespace>Wox.Infrastructure</RootNamespace>
1110
<AssemblyName>Wox.Infrastructure</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
15-
<TargetFrameworkProfile />
1611
</PropertyGroup>
12+
1713
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1814
<DebugSymbols>true</DebugSymbols>
1915
<DebugType>full</DebugType>
@@ -25,6 +21,7 @@
2521
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2622
<Prefer32Bit>false</Prefer32Bit>
2723
</PropertyGroup>
24+
2825
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2926
<DebugType>pdbonly</DebugType>
3027
<Optimize>true</Optimize>
@@ -35,87 +32,38 @@
3532
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
3633
<Prefer32Bit>false</Prefer32Bit>
3734
</PropertyGroup>
38-
<ItemGroup>
39-
<Reference Include="PresentationCore" />
40-
<Reference Include="PresentationFramework" />
41-
<Reference Include="System" />
42-
<Reference Include="System.Core" />
43-
<Reference Include="System.Drawing" />
44-
<Reference Include="System.Net.Http" />
45-
<Reference Include="System.Xaml" />
46-
<Reference Include="System.Xml" />
47-
<Reference Include="WindowsBase" />
48-
</ItemGroup>
49-
<ItemGroup>
50-
<Compile Include="..\SolutionAssemblyInfo.cs">
51-
<Link>Properties\SolutionAssemblyInfo.cs</Link>
52-
</Compile>
53-
<Compile Include="Exception\ExceptionFormatter.cs" />
54-
<Compile Include="Helper.cs" />
55-
<Compile Include="Hotkey\InterceptKeys.cs" />
56-
<Compile Include="Hotkey\KeyEvent.cs" />
57-
<Compile Include="Image\ImageCache.cs" />
58-
<Compile Include="Image\ImageHashGenerator.cs" />
59-
<Compile Include="Image\ImageLoader.cs" />
60-
<Compile Include="Image\ThumbnailReader.cs" />
61-
<Compile Include="Logger\Log.cs" />
62-
<Compile Include="Storage\ISavable.cs" />
63-
<Compile Include="Storage\PluginJsonStorage.cs" />
64-
<Compile Include="Stopwatch.cs" />
65-
<Compile Include="Storage\BinaryStorage.cs" />
66-
<Compile Include="Storage\JsonStorage.cs" />
67-
<Compile Include="Storage\WoxJsonStorage.cs" />
68-
<Compile Include="StringMatcher.cs" />
69-
<Compile Include="Http\Http.cs" />
70-
<Compile Include="FuzzyMatcher.cs" />
71-
<Compile Include="Hotkey\GlobalHotkey.cs" />
72-
<Compile Include="Hotkey\HotkeyModel.cs" />
73-
<Compile Include="Properties\AssemblyInfo.cs" />
74-
<Compile Include="Alphabet.cs" />
75-
<Compile Include="UserSettings\HttpProxy.cs" />
76-
<Compile Include="UserSettings\PluginHotkey.cs" />
77-
<Compile Include="UserSettings\PluginSettings.cs" />
78-
<Compile Include="UserSettings\Settings.cs" />
79-
<Compile Include="Wox.cs" />
80-
</ItemGroup>
35+
8136
<ItemGroup>
8237
<ProjectReference Include="..\Wox.Plugin\Wox.Plugin.csproj">
8338
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
8439
<Name>Wox.Plugin</Name>
8540
</ProjectReference>
8641
</ItemGroup>
42+
8743
<ItemGroup>
88-
<PackageReference Include="JetBrains.Annotations">
89-
<Version>10.3.0</Version>
90-
</PackageReference>
91-
<PackageReference Include="Newtonsoft.Json">
92-
<Version>9.0.1</Version>
93-
</PackageReference>
94-
<PackageReference Include="NLog">
95-
<Version>4.2.0</Version>
96-
</PackageReference>
97-
<PackageReference Include="NLog.Schema" GeneratePathProperty="true">
98-
<Version>4.2.0</Version>
99-
</PackageReference>
100-
<PackageReference Include="Pinyin4DotNet" GeneratePathProperty="true">
101-
<Version>2016.4.23.4</Version>
102-
</PackageReference>
103-
<PackageReference Include="System.Runtime">
104-
<Version>4.0.0</Version>
105-
</PackageReference>
44+
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
45+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
46+
<PackageReference Include="NLog.Schema" Version="4.7.0-rc1" />
47+
<PackageReference Include="NLog.Web.AspNetCore" Version="4.9.0" />
48+
<PackageReference Include="Pinyin4DotNet" Version="2016.4.23.4" />
49+
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
50+
<PackageReference Include="System.Runtime" Version="4.3.1" />
10651
</ItemGroup>
107-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
108-
<PropertyGroup>
109-
<PreBuildEvent>
110-
xcopy /Y $(PkgPinyin4DotNet)\pinyindb\unicode_to_hanyu_pinyin.txt $(TargetDir)pinyindb\
111-
xcopy /Y $(PkgNLog_Schema)\content\NLog.xsd $(TargetDir)
112-
</PreBuildEvent>
113-
</PropertyGroup>
114-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
115-
Other similar extension points exist, see Microsoft.Common.targets.
116-
<Target Name="BeforeBuild">
117-
</Target>
118-
<Target Name="AfterBuild">
119-
</Target>
120-
-->
52+
53+
<ItemGroup>
54+
<Folder Include="Properties\" />
55+
</ItemGroup>
56+
57+
<ItemGroup>
58+
<None Update="pinyindb\pinyin_gwoyeu_mapping.xml">
59+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
60+
</None>
61+
<None Update="pinyindb\pinyin_mapping.xml">
62+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
63+
</None>
64+
<None Update="pinyindb\unicode_to_hanyu_pinyin.txt">
65+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
66+
</None>
67+
</ItemGroup>
68+
12169
</Project>

Wox.Plugin/PluginInitContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Wox.Plugin
44
{
55
public class PluginInitContext
66
{
7-
public PluginMetadata CurrentPluginMetadata { get; internal set; }
7+
public PluginMetadata CurrentPluginMetadata { get; set; }
88

99
/// <summary>
1010
/// Public APIs for plugin invocation

Wox.Plugin/PluginMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class PluginMetadata : BaseModel
2424
public string PluginDirectory
2525
{
2626
get { return _pluginDirectory; }
27-
internal set
27+
set
2828
{
2929
_pluginDirectory = value;
3030
ExecuteFilePath = Path.Combine(value, ExecuteFileName);

Wox.Plugin/PluginPair.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
public class PluginPair
44
{
5-
public IPlugin Plugin { get; internal set; }
6-
public PluginMetadata Metadata { get; internal set; }
5+
public IPlugin Plugin { get; set; }
6+
public PluginMetadata Metadata { get; set; }
77

88

99

Wox.Plugin/Query.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Wox.Plugin
66
{
77
public class Query
88
{
9-
internal Query() { }
9+
public Query() { }
1010

1111
/// <summary>
1212
/// to allow unit tests for plug ins
@@ -23,15 +23,15 @@ public Query(string rawQuery, string search, string[] terms, string actionKeywor
2323
/// Raw query, this includes action keyword if it has
2424
/// We didn't recommend use this property directly. You should always use Search property.
2525
/// </summary>
26-
public string RawQuery { get; internal set; }
26+
public string RawQuery { get; set; }
2727

2828
/// <summary>
2929
/// Search part of a query.
3030
/// This will not include action keyword if exclusive plugin gets it, otherwise it should be same as RawQuery.
3131
/// Since we allow user to switch a exclusive plugin to generic plugin,
3232
/// so this property will always give you the "real" query part of the query
3333
/// </summary>
34-
public string Search { get; internal set; }
34+
public string Search { get; set; }
3535

3636
/// <summary>
3737
/// The raw query splited into a string array.
@@ -96,10 +96,10 @@ private string SplitSearch(int index)
9696
public override string ToString() => RawQuery;
9797

9898
[Obsolete("Use ActionKeyword, this property will be removed in v1.3.0")]
99-
public string ActionName { get; internal set; }
99+
public string ActionName { get; set; }
100100

101101
[Obsolete("Use Search instead, this property will be removed in v1.3.0")]
102-
public List<string> ActionParameters { get; internal set; }
102+
public List<string> ActionParameters { get; set; }
103103

104104
[Obsolete("Use Search instead, this method will be removed in v1.3.0")]
105105
public string GetAllRemainingParameter() => Search;

0 commit comments

Comments
 (0)