Skip to content

Commit 18cb5e4

Browse files
authored
Main Project Cleanup (#1123)
* Main Project Cleanup - Clean up of the main source code project - Removed irrelevant files - Added support for .NET 4.7, .NET 4.8 - Removed preprocessor to enable events registration for all - Updates to the SvgOptions class to support property attributes * Untabify the project files - Applying the default "Format Document" introduces the tabs! * Restore the default interpolation mode of the GDI+ rendererer - Set the default mode to InterpolationMode.Default * Further clean up - Removed NuGet project files and folder - Removed non-existence folder: <Folder Include="Web\Resources\" /> * Removed the commented Enums static class - Enums no longer needed.
1 parent 94b8e31 commit 18cb5e4

28 files changed

+645
-557
lines changed

Generators/Svg.Generators.csproj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5-
<OutputType>Library</OutputType>
6-
<IsPackable>False</IsPackable>
7-
<AnalysisLevel>latest</AnalysisLevel>
8-
<Nullable>enable</Nullable>
9-
<LangVersion>latest</LangVersion>
10-
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
11-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5+
<OutputType>Library</OutputType>
6+
<IsPackable>False</IsPackable>
7+
<AnalysisLevel>latest</AnalysisLevel>
8+
<Nullable>enable</Nullable>
9+
<LangVersion>latest</LangVersion>
10+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
11+
</PropertyGroup>
1212

13-
<ItemGroup>
14-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" PrivateAssets="all" />
15-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
16-
</ItemGroup>
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" PrivateAssets="all" />
15+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
16+
</ItemGroup>
1717

1818
</Project>

Samples/Entities/Entities.csproj

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
6-
</PropertyGroup>
7-
8-
<ItemGroup>
9-
<ProjectReference Include="..\..\Source\Svg.csproj" />
10-
</ItemGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
6+
</PropertyGroup>
7+
8+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
9+
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
10+
</PropertyGroup>
11+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
12+
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\..\Source\Svg.csproj" />
17+
</ItemGroup>
1118

1219
</Project>
Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

3-
<PropertyGroup>
4-
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
6-
<UseWindowsForms>true</UseWindowsForms>
7-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
8-
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
6+
<UseWindowsForms>true</UseWindowsForms>
7+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
8+
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
9+
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<ProjectReference Include="..\..\Source\Svg.csproj" />
13-
</ItemGroup>
11+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
12+
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
15+
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
16+
</PropertyGroup>
1417

15-
<ItemGroup>
16-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
17-
<PrivateAssets>all</PrivateAssets>
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
</PackageReference>
20-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
21-
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
22-
</ItemGroup>
18+
<ItemGroup>
19+
<ProjectReference Include="..\..\Source\Svg.csproj" />
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
24+
<PrivateAssets>all</PrivateAssets>
25+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26+
</PackageReference>
27+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
28+
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
29+
</ItemGroup>
2330

2431
</Project>

Samples/SVGViewer/SVGViewer.csproj

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

3-
<PropertyGroup>
4-
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
6-
<UseWindowsForms>true</UseWindowsForms>
7-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
8-
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
6+
<UseWindowsForms>true</UseWindowsForms>
7+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
8+
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
9+
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<ProjectReference Include="..\..\Source\Svg.csproj" />
13-
</ItemGroup>
11+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
12+
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
15+
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
16+
</PropertyGroup>
1417

15-
<ItemGroup>
16-
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
17-
</ItemGroup>
18+
<ItemGroup>
19+
<ProjectReference Include="..\..\Source\Svg.csproj" />
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
24+
</ItemGroup>
1825

1926
</Project>
Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
6-
<IsPackable>False</IsPackable>
7-
<IsTool>True</IsTool>
8-
<PackAsTool>True</PackAsTool>
9-
<ToolCommandName>SvgConsole</ToolCommandName>
10-
<LangVersion>7.3</LangVersion>
11-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<IsPackable>False</IsPackable>
7+
<IsTool>True</IsTool>
8+
<PackAsTool>True</PackAsTool>
9+
<ToolCommandName>SvgConsole</ToolCommandName>
10+
<LangVersion>7.3</LangVersion>
11+
</PropertyGroup>
1212

13-
<PropertyGroup>
14-
<PublishTrimmed>False</PublishTrimmed>
15-
<PublishReadyToRun>False</PublishReadyToRun>
16-
</PropertyGroup>
13+
<PropertyGroup>
14+
<PublishTrimmed>False</PublishTrimmed>
15+
<PublishReadyToRun>False</PublishReadyToRun>
16+
</PropertyGroup>
1717

18-
<ItemGroup>
19-
<ProjectReference Include="..\..\Source\Svg.csproj" />
20-
</ItemGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
20+
</PropertyGroup>
21+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
22+
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
23+
</PropertyGroup>
2124

22-
<ItemGroup>
23-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
24-
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2" />
25-
</ItemGroup>
25+
<ItemGroup>
26+
<ProjectReference Include="..\..\Source\Svg.csproj" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
31+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2" />
32+
</ItemGroup>
2633

2734
</Project>
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
6-
</PropertyGroup>
7-
8-
<ItemGroup>
9-
<ProjectReference Include="..\..\Source\Svg.csproj" />
10-
</ItemGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
6+
</PropertyGroup>
7+
8+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
9+
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
10+
</PropertyGroup>
11+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
12+
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\..\Source\Svg.csproj" />
17+
</ItemGroup>
1118

1219
</Project>

Source/DataTypes/EnumConverters.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,4 @@ public sealed class SvgMorphologyOperatorConverter : EnumBaseConverter<SvgMorpho
219219
public sealed class SvgStitchTypeConverter : EnumBaseConverter<SvgStitchType> { }
220220

221221
public sealed class SvgTurbulenceTypeConverter : EnumBaseConverter<SvgTurbulenceType> { }
222-
223-
public static class Enums
224-
{
225-
[CLSCompliant(false)]
226-
public static bool TryParse<TEnum>(string value, out TEnum result) where TEnum : struct, IConvertible
227-
{
228-
try
229-
{
230-
result = (TEnum)Enum.Parse(typeof(TEnum), value, true);
231-
return true;
232-
}
233-
catch
234-
{
235-
result = default(TEnum);
236-
return false;
237-
}
238-
}
239-
}
240222
}

Source/DataTypes/SvgAspectRatioConverter.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ public override object ConvertFrom(ITypeDescriptorContext context, System.Global
3737
throw new ArgumentOutOfRangeException("value is not a member of SvgPreserveAspectRatio");
3838
}
3939

40-
#if Net4
41-
if (!Enum.TryParse<SvgPreserveAspectRatio>(sParts[nAlignIndex], out eAlign))
40+
if (!Enum.TryParse(sParts[nAlignIndex], out eAlign))
4241
throw new ArgumentOutOfRangeException("value is not a member of SvgPreserveAspectRatio");
43-
#else
44-
eAlign = (SvgPreserveAspectRatio)Enum.Parse(typeof(SvgPreserveAspectRatio), sParts[nAlignIndex]);
45-
#endif
4642

4743
nAlignIndex++;
4844

Source/DataTypes/SvgUnitCollection.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ public override string ToString()
5454
// (e.g., 'M 100 100 L 200 200' contains unnecessary spaces and could be expressed more compactly as 'M100 100L200 200')."
5555
// http://www.w3.org/TR/SVGTiny12/paths.html#PathDataGeneralInformation
5656
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#Notes
57-
#if Net4
57+
5858
return string.Join(" ", this.Select(u => u.ToString()));
59-
#else
60-
return string.Join(" ", this.Select(u => u.ToString()).ToArray());
61-
#endif
6259
}
6360

6461
public static bool IsNullOrEmpty(SvgUnitCollection collection)

Source/Local.testsettings

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

0 commit comments

Comments
 (0)