Skip to content

Commit 558283a

Browse files
committed
wip: .NET Core Support
This is still work in progress. Current issues: - [ ] Internals are not visible to tests/SRM, which breaks the build - [ ] README needs updating with compatibility matrix - [ ] Extensions built with .NET Core need testing
1 parent 1bbea79 commit 558283a

Some content is hidden

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

41 files changed

+1432
-1587
lines changed
Lines changed: 9 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,8 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
32
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{E48D396E-04AC-40C8-9046-66A896EF3568}</ProjectGuid>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
94
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>CountLinesExtension</RootNamespace>
12-
<AssemblyName>CountLinesExtension</AssemblyName>
13-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<SccProjectName>
16-
</SccProjectName>
17-
<SccLocalPath>
18-
</SccLocalPath>
19-
<SccAuxPath>
20-
</SccAuxPath>
21-
<SccProvider>
22-
</SccProvider>
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25-
<DebugSymbols>true</DebugSymbols>
26-
<DebugType>full</DebugType>
27-
<Optimize>false</Optimize>
28-
<OutputPath>bin\Debug\</OutputPath>
29-
<DefineConstants>DEBUG;TRACE</DefineConstants>
30-
<ErrorReport>prompt</ErrorReport>
31-
<WarningLevel>4</WarningLevel>
32-
</PropertyGroup>
33-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34-
<DebugType>pdbonly</DebugType>
35-
<Optimize>true</Optimize>
36-
<OutputPath>bin\Release\</OutputPath>
37-
<DefineConstants>TRACE</DefineConstants>
38-
<ErrorReport>prompt</ErrorReport>
39-
<WarningLevel>4</WarningLevel>
5+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
406
</PropertyGroup>
417
<PropertyGroup>
428
<SignAssembly>true</SignAssembly>
@@ -48,55 +14,27 @@
4814
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
4915
</PropertyGroup>
5016
<ItemGroup>
51-
<Reference Include="System" />
52-
<Reference Include="System.Core" />
53-
<Reference Include="System.Drawing" />
54-
<Reference Include="System.Windows.Forms" />
55-
<Reference Include="System.Xml.Linq" />
56-
<Reference Include="System.Data.DataSetExtensions" />
57-
<Reference Include="Microsoft.CSharp" />
58-
<Reference Include="System.Data" />
59-
<Reference Include="System.Xml" />
60-
</ItemGroup>
61-
<ItemGroup>
62-
<Compile Include="CountLinesExtension.cs" />
63-
<Compile Include="Properties\AssemblyInfo.cs" />
64-
<Compile Include="Properties\Resources.Designer.cs">
17+
<Compile Update="Properties\Resources.Designer.cs">
6518
<AutoGen>True</AutoGen>
6619
<DesignTime>True</DesignTime>
6720
<DependentUpon>Resources.resx</DependentUpon>
6821
</Compile>
6922
</ItemGroup>
7023
<ItemGroup>
71-
<ProjectReference Include="..\..\..\SharpShell\SharpShell.csproj">
72-
<Project>{B5D5F670-BFBA-4D09-91C6-74BB12B7EDD4}</Project>
73-
<Name>SharpShell</Name>
74-
</ProjectReference>
24+
<ProjectReference Include="..\..\..\SharpShell\SharpShell.csproj" />
7525
</ItemGroup>
7626
<ItemGroup>
77-
<EmbeddedResource Include="Properties\Resources.resx">
27+
<EmbeddedResource Update="Properties\Resources.resx">
7828
<Generator>ResXFileCodeGenerator</Generator>
7929
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
8030
<SubType>Designer</SubType>
8131
</EmbeddedResource>
8232
</ItemGroup>
8333
<ItemGroup>
84-
<None Include="Key.snk" />
85-
<None Include="Resources\CountLines.bmp" />
34+
<Content Include="Resources\CountLines.png" />
8635
</ItemGroup>
8736
<ItemGroup>
88-
<Content Include="Resources\CountLines.png" />
37+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
38+
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
8939
</ItemGroup>
90-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
91-
<PropertyGroup>
92-
<PostBuildEvent>
93-
</PostBuildEvent>
94-
</PropertyGroup>
95-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
96-
Other similar extension points exist, see Microsoft.Common.targets.
97-
<Target Name="BeforeBuild">
98-
</Target>
99-
<Target Name="AfterBuild">
100-
</Target>
101-
-->
10240
</Project>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{E48D396E-04AC-40C8-9046-66A896EF3568}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>CountLinesExtension</RootNamespace>
12+
<AssemblyName>CountLinesExtension</AssemblyName>
13+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<SccProjectName>
16+
</SccProjectName>
17+
<SccLocalPath>
18+
</SccLocalPath>
19+
<SccAuxPath>
20+
</SccAuxPath>
21+
<SccProvider>
22+
</SccProvider>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25+
<DebugSymbols>true</DebugSymbols>
26+
<DebugType>full</DebugType>
27+
<Optimize>false</Optimize>
28+
<OutputPath>bin\Debug\</OutputPath>
29+
<DefineConstants>DEBUG;TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34+
<DebugType>pdbonly</DebugType>
35+
<Optimize>true</Optimize>
36+
<OutputPath>bin\Release\</OutputPath>
37+
<DefineConstants>TRACE</DefineConstants>
38+
<ErrorReport>prompt</ErrorReport>
39+
<WarningLevel>4</WarningLevel>
40+
</PropertyGroup>
41+
<PropertyGroup>
42+
<SignAssembly>true</SignAssembly>
43+
</PropertyGroup>
44+
<PropertyGroup>
45+
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
46+
</PropertyGroup>
47+
<PropertyGroup>
48+
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
49+
</PropertyGroup>
50+
<ItemGroup>
51+
<Reference Include="System" />
52+
<Reference Include="System.Core" />
53+
<Reference Include="System.Drawing" />
54+
<Reference Include="System.Windows.Forms" />
55+
<Reference Include="System.Xml.Linq" />
56+
<Reference Include="System.Data.DataSetExtensions" />
57+
<Reference Include="Microsoft.CSharp" />
58+
<Reference Include="System.Data" />
59+
<Reference Include="System.Xml" />
60+
</ItemGroup>
61+
<ItemGroup>
62+
<Compile Include="CountLinesExtension.cs" />
63+
<Compile Include="Properties\AssemblyInfo.cs" />
64+
<Compile Include="Properties\Resources.Designer.cs">
65+
<AutoGen>True</AutoGen>
66+
<DesignTime>True</DesignTime>
67+
<DependentUpon>Resources.resx</DependentUpon>
68+
</Compile>
69+
</ItemGroup>
70+
<ItemGroup>
71+
<ProjectReference Include="..\..\..\SharpShell\SharpShell.csproj">
72+
<Project>{B5D5F670-BFBA-4D09-91C6-74BB12B7EDD4}</Project>
73+
<Name>SharpShell</Name>
74+
</ProjectReference>
75+
</ItemGroup>
76+
<ItemGroup>
77+
<EmbeddedResource Include="Properties\Resources.resx">
78+
<Generator>ResXFileCodeGenerator</Generator>
79+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
80+
<SubType>Designer</SubType>
81+
</EmbeddedResource>
82+
</ItemGroup>
83+
<ItemGroup>
84+
<None Include="Key.snk" />
85+
<None Include="Resources\CountLines.bmp" />
86+
</ItemGroup>
87+
<ItemGroup>
88+
<Content Include="Resources\CountLines.png" />
89+
</ItemGroup>
90+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
91+
<PropertyGroup>
92+
<PostBuildEvent>
93+
</PostBuildEvent>
94+
</PropertyGroup>
95+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
96+
Other similar extension points exist, see Microsoft.Common.targets.
97+
<Target Name="BeforeBuild">
98+
</Target>
99+
<Target Name="AfterBuild">
100+
</Target>
101+
-->
102+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Runtime.InteropServices;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using SharpShell.Attributes;
8+
using SharpShell.SharpPropertySheet;
9+
10+
namespace TextInfoPropertySheet
11+
{
12+
13+
/// <summary>
14+
/// The ResourcesPropertySheet is a shell extension to show the managed
15+
/// and unmanaged resources contained in binary files.
16+
/// </summary>
17+
[ComVisible(true)]
18+
[COMServerAssociation(AssociationType.ClassOfExtension, ".txt")]
19+
public class TextInfoPropertySheet : SharpPropertySheet
20+
{
21+
/// <summary>
22+
/// Determines whether this instance can show a shell property sheet, given the specified selected file list.
23+
/// </summary>
24+
/// <returns>
25+
/// <c>true</c> if this instance should show a shell property sheet for the specified file list; otherwise, <c>false</c>.
26+
/// </returns>
27+
protected override bool CanShowSheet()
28+
{
29+
// We will only show the text info pages if we have ONE file selected.
30+
return SelectedItemPaths.Count() == 1;
31+
}
32+
33+
/// <summary>
34+
/// Creates the pages.
35+
/// </summary>
36+
/// <returns>
37+
/// The property sheet pages.
38+
/// </returns>
39+
protected override IEnumerable<SharpPropertyPage> CreatePages()
40+
{
41+
var view = new ResourcesView();
42+
return new[] {view};
43+
}
44+
}
45+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<UseWPF>true</UseWPF>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<ProjectReference Include="..\..\..\SharpShell\SharpShell.csproj" />
10+
</ItemGroup>
11+
12+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<UserControl x:Class="TextInfoPropertySheet.UserControl1"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:TextInfoPropertySheet"
7+
mc:Ignorable="d"
8+
d:DesignHeight="450" d:DesignWidth="800">
9+
<Grid>
10+
11+
</Grid>
12+
</UserControl>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace TextInfoPropertySheet
17+
{
18+
/// <summary>
19+
/// Interaction logic for UserControl1.xaml
20+
/// </summary>
21+
public partial class UserControl1 : UserControl
22+
{
23+
public UserControl1()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

SharpShell/SharedAssemblyInfo.cs

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

SharpShell/SharpShell.Tests/Properties/AssemblyInfo.cs

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

0 commit comments

Comments
 (0)