* 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.
This commit is contained in:
Paul Selormey 2024-01-18 12:05:57 +09:00 коммит произвёл GitHub
Родитель 94b8e3101a
Коммит 18cb5e45fe
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
28 изменённых файлов: 638 добавлений и 550 удалений

Просмотреть файл

@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<IsPackable>False</IsPackable>
<AnalysisLevel>latest</AnalysisLevel>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<IsPackable>False</IsPackable>
<AnalysisLevel>latest</AnalysisLevel>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,12 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,24 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,19 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,27 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>False</IsPackable>
<IsTool>True</IsTool>
<PackAsTool>True</PackAsTool>
<ToolCommandName>SvgConsole</ToolCommandName>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>False</IsPackable>
<IsTool>True</IsTool>
<PackAsTool>True</PackAsTool>
<ToolCommandName>SvgConsole</ToolCommandName>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup>
<PublishTrimmed>False</PublishTrimmed>
<PublishReadyToRun>False</PublishReadyToRun>
</PropertyGroup>
<PropertyGroup>
<PublishTrimmed>False</PublishTrimmed>
<PublishReadyToRun>False</PublishReadyToRun>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,12 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -219,22 +219,4 @@ namespace Svg
public sealed class SvgStitchTypeConverter : EnumBaseConverter<SvgStitchType> { }
public sealed class SvgTurbulenceTypeConverter : EnumBaseConverter<SvgTurbulenceType> { }
public static class Enums
{
[CLSCompliant(false)]
public static bool TryParse<TEnum>(string value, out TEnum result) where TEnum : struct, IConvertible
{
try
{
result = (TEnum)Enum.Parse(typeof(TEnum), value, true);
return true;
}
catch
{
result = default(TEnum);
return false;
}
}
}
}

Просмотреть файл

@ -37,12 +37,8 @@ namespace Svg.DataTypes
throw new ArgumentOutOfRangeException("value is not a member of SvgPreserveAspectRatio");
}
#if Net4
if (!Enum.TryParse<SvgPreserveAspectRatio>(sParts[nAlignIndex], out eAlign))
if (!Enum.TryParse(sParts[nAlignIndex], out eAlign))
throw new ArgumentOutOfRangeException("value is not a member of SvgPreserveAspectRatio");
#else
eAlign = (SvgPreserveAspectRatio)Enum.Parse(typeof(SvgPreserveAspectRatio), sParts[nAlignIndex]);
#endif
nAlignIndex++;

Просмотреть файл

@ -54,11 +54,8 @@ namespace Svg
// (e.g., 'M 100 100 L 200 200' contains unnecessary spaces and could be expressed more compactly as 'M100 100L200 200')."
// http://www.w3.org/TR/SVGTiny12/paths.html#PathDataGeneralInformation
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#Notes
#if Net4
return string.Join(" ", this.Select(u => u.ToString()));
#else
return string.Join(" ", this.Select(u => u.ToString()).ToArray());
#endif
}
public static bool IsNullOrEmpty(SvgUnitCollection collection)

Просмотреть файл

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="616d39c5-86e4-40f8-97e9-b8a423ce7322" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment enabled="false" />
<Execution>
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
</TestSettings>

Просмотреть файл

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

Просмотреть файл

@ -135,7 +135,7 @@ namespace Svg
g.CompositingQuality = CompositingQuality.HighQuality;
g.TextRenderingHint = TextRenderingHint.AntiAlias;
g.TextContrast = 1;
g.InterpolationMode = InterpolationMode.NearestNeighbor;
g.InterpolationMode = InterpolationMode.Default;
return g;
}

Просмотреть файл

@ -1,102 +1,150 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1;netstandard2.1;netstandard2.0;net462</TargetFrameworks>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<RootNamespace>Svg</RootNamespace>
<AssemblyName>Svg</AssemblyName>
<IsPackable>true</IsPackable>
<Company></Company>
<Authors>davescriven, jvenema, mrbean-bremen, H1Gdev, Wiesław Šoltés, owaits, ddpruitt, Ralf1108, Tebjan Halm, and others</Authors>
<PackageId>Svg</PackageId>
<Product>SVG Rendering Library</Product>
<Summary>SVG Rendering Library</Summary>
<Description>
Public fork of the C# SVG rendering library on codeplex: https://svg.codeplex.com/
This started out as a minor modification to enable the writing of proper SVG strings. But now after almost two years we have so many fixes and improvements that we decided to share our current codebase to the public in order to improve it even further.
So please feel free to fork it and open pull requests for any fix, improvement or feature you add.
License: Microsoft Public License: https://svg.codeplex.com/license
</Description>
<Copyright>Copyright © vvvv.org</Copyright>
<Tags>svg, vector graphics, rendering</Tags>
<ProjectGuid>{886A98C5-37C0-4E8B-885E-30C1D2F98B47}</ProjectGuid>
<Configurations>Debug;Release</Configurations>
<NoWarn>1591</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>svgkey.snk</AssemblyOriginatorKeyFile>
<PackageTags>svg, vector graphics, rendering</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>Fixed a regression in loading embedded images (see Release Notes: http://svg-net.github.io/SVG/doc/ReleaseNotes.html).
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/svg-net/SVG</PackageProjectUrl>
<PackageIconUrl>https://www.w3.org/Icons/SVG/svg-logo-v.png</PackageIconUrl>
<PackageIcon>svg-logo-v.png</PackageIcon>
<LangVersion>10.0</LangVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)\$(TargetFramework)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1;netstandard2.1;netstandard2.0;net462;net472;net481</TargetFrameworks>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<RootNamespace>Svg</RootNamespace>
<AssemblyName>Svg</AssemblyName>
<IsPackable>true</IsPackable>
<Company></Company>
<Authors>davescriven, jvenema, mrbean-bremen, H1Gdev, Wiesław Šoltés, owaits, ddpruitt, Ralf1108, Tebjan Halm, and others</Authors>
<PackageId>Svg</PackageId>
<Product>SVG Rendering Library</Product>
<Summary>SVG Rendering Library</Summary>
<Description>
Public fork of the C# SVG rendering library on codeplex.
This started out as a minor modification to enable the writing of proper SVG strings. But now after almost two years we have so many fixes and improvements that we decided to share our current codebase to the public in order to improve it even further.
So please feel free to fork it and open pull requests for any fix, improvement or feature you add.
License: Microsoft Public License.
</Description>
<Copyright>Copyright © vvvv.org</Copyright>
<Tags>svg, vector graphics, rendering</Tags>
<ProjectGuid>{886A98C5-37C0-4E8B-885E-30C1D2F98B47}</ProjectGuid>
<Configurations>Debug;Release</Configurations>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>svgkey.snk</AssemblyOriginatorKeyFile>
<PackageTags>svg, vector graphics, rendering</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>
Fixed a regression in loading embedded images (see Release Notes: http://svg-net.github.io/SVG/doc/ReleaseNotes.html).
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/svg-net/SVG</PackageProjectUrl>
<PackageIconUrl>https://www.w3.org/Icons/SVG/svg-logo-v.png</PackageIconUrl>
<PackageIcon>svg-logo-v.png</PackageIcon>
<LangVersion>10.0</LangVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)\$(TargetFramework)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="$(TargetFramework.StartsWith('net46'))">$(DefineConstants);DOTNET46;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net47'))">$(DefineConstants);DOTNET47;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net48'))">$(DefineConstants);DOTNET48;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netstandard'))">$(DefineConstants);NETSTANDARD</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netcore'))">$(DefineConstants);NETCORE</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6'))">$(DefineConstants);NETCORE;NETNEXT</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net7'))">$(DefineConstants);NETCORE;NETNEXT</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net8'))">$(DefineConstants);NETCORE;NETNEXT</DefineConstants>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\svg11.dtd" />
<Folder Include="Web\Resources\" />
<None Include="Basic Shapes\DOM.cd" />
<None Include="svgkey.snk" />
<None Include="svg-logo-v.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\svg11.dtd" />
<None Include="Basic Shapes\DOM.cd" />
<None Include="svgkey.snk" />
<None Include="svg-logo-v.png" Pack="true" PackagePath="" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net462'">
<Title>Svg for .Net Framework 4.6.2</Title>
<DefineConstants>$(DefineConstants);NETFULL;Net4</DefineConstants>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup>
<Compile Remove=".\Resources\svg11.dtd" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard2.1' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net462'">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
<!-- Mac specific include -->
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="5.8.64" />
</ItemGroup>
<!-- Mac specific include -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<!-- Mac specific include -->
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="5.8.64" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="5.8.64" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
</ItemGroup>
<ItemGroup>
<Compile Remove=".\Resources\svg11.dtd" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ExCSS" Version="4.2.3" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Generators\Svg.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ExCSS" Version="4.2.3" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Generators\Svg.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,10 +0,0 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

Просмотреть файл

@ -1,10 +0,0 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
</metadata>
</package>

Просмотреть файл

@ -1,2 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Fizzler/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Просмотреть файл

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="616d39c5-86e4-40f8-97e9-b8a423ce7322" name="Local" storage="local.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
</TestLists>

Просмотреть файл

@ -35,8 +35,7 @@ namespace Svg
/// <param name="specificity">The specificity value.</param>
public void AddStyle(string name, string value, int specificity)
{
SortedDictionary<int, string> rules;
if (!_styles.TryGetValue(name, out rules))
if (!_styles.TryGetValue(name, out SortedDictionary<int, string> rules))
{
rules = new SortedDictionary<int, string>();
_styles[name] = rules;
@ -71,21 +70,19 @@ namespace Svg
public bool ContainsAttribute(string name)
{
SortedDictionary<int, string> rules;
return (this.Attributes.ContainsKey(name) || this.CustomAttributes.ContainsKey(name) ||
(_styles.TryGetValue(name, out rules)) && (rules.ContainsKey(StyleSpecificity_InlineStyle) || rules.ContainsKey(StyleSpecificity_PresAttribute)));
(_styles.TryGetValue(name, out SortedDictionary<int, string> rules))
&& (rules.ContainsKey(StyleSpecificity_InlineStyle) || rules.ContainsKey(StyleSpecificity_PresAttribute)));
}
public bool TryGetAttribute(string name, out string value)
{
object objValue;
if (this.Attributes.TryGetValue(name, out objValue))
if (this.Attributes.TryGetValue(name, out object objValue))
{
value = objValue.ToString();
return true;
}
if (this.CustomAttributes.TryGetValue(name, out value)) return true;
SortedDictionary<int, string> rules;
if (_styles.TryGetValue(name, out rules))
if (_styles.TryGetValue(name, out SortedDictionary<int, string> rules))
{
// Get staged styles that are
if (rules.TryGetValue(StyleSpecificity_InlineStyle, out value)) return true;
@ -597,8 +594,7 @@ namespace Svg
if (writeStyle && propertyValue == SvgPaintServer.NotSet)
continue;
object parentValue;
if (TryResolveParentAttributeValue(property.AttributeName, out parentValue))
if (TryResolveParentAttributeValue(property.AttributeName, out object parentValue))
{
if ((parentValue == propertyValue)
|| ((parentValue != null) && parentValue.Equals(propertyValue)))
@ -690,7 +686,7 @@ namespace Svg
return styles;
}
private void WriteAttributeString(XmlWriter writer, string name, string ns, string value)
private static void WriteAttributeString(XmlWriter writer, string name, string ns, string value)
{
if (string.IsNullOrEmpty(ns))
writer.WriteAttributeString(name, value);
@ -912,7 +908,6 @@ namespace Svg
onmouseout = "<anything>"
*/
#if Net4
/// <summary>
/// Use this method to provide your implementation ISvgEventCaller which can register Actions
/// and call them if one of the events occurs. Make sure, that your SvgElement has a unique ID.
@ -925,12 +920,12 @@ namespace Svg
{
var rpcID = this.ID + "/";
caller.RegisterAction<float, float, int, int, bool, bool, bool, string>(rpcID + "onclick", CreateMouseEventAction(RaiseMouseClick));
caller.RegisterAction<float, float, int, int, bool, bool, bool, string>(rpcID + "onmousedown", CreateMouseEventAction(RaiseMouseDown));
caller.RegisterAction<float, float, int, int, bool, bool, bool, string>(rpcID + "onmouseup", CreateMouseEventAction(RaiseMouseUp));
caller.RegisterAction<float, float, int, int, bool, bool, bool, string>(rpcID + "onmousemove", CreateMouseEventAction(RaiseMouseMove));
caller.RegisterAction<float, float, int, int, bool, bool, bool, string>(rpcID + "onmouseover", CreateMouseEventAction(RaiseMouseOver));
caller.RegisterAction<float, float, int, int, bool, bool, bool, string>(rpcID + "onmouseout", CreateMouseEventAction(RaiseMouseOut));
caller.RegisterAction(rpcID + "onclick", CreateMouseEventAction(RaiseMouseClick));
caller.RegisterAction(rpcID + "onmousedown", CreateMouseEventAction(RaiseMouseDown));
caller.RegisterAction(rpcID + "onmouseup", CreateMouseEventAction(RaiseMouseUp));
caller.RegisterAction(rpcID + "onmousemove", CreateMouseEventAction(RaiseMouseMove));
caller.RegisterAction(rpcID + "onmouseover", CreateMouseEventAction(RaiseMouseOver));
caller.RegisterAction(rpcID + "onmouseout", CreateMouseEventAction(RaiseMouseOut));
caller.RegisterAction<int, bool, bool, bool, string>(rpcID + "onmousescroll", OnMouseScroll);
}
}
@ -954,7 +949,6 @@ namespace Svg
caller.UnregisterAction(rpcID + "onmouseout");
}
}
#endif
[SvgAttribute("onclick")]
public event EventHandler<MouseArg> Click;
@ -977,13 +971,11 @@ namespace Svg
[SvgAttribute("onmouseout")]
public event EventHandler<MouseArg> MouseOut;
#if Net4
protected Action<float, float, int, int, bool, bool, bool, string> CreateMouseEventAction(Action<object, MouseArg> eventRaiser)
{
return (x, y, button, clickCount, altKey, shiftKey, ctrlKey, sessionID) =>
eventRaiser(this, new MouseArg { x = x, y = y, Button = button, ClickCount = clickCount, AltKey = altKey, ShiftKey = shiftKey, CtrlKey = ctrlKey, SessionID = sessionID });
}
#endif
//click
protected void RaiseMouseClick(object sender, MouseArg e)
@ -1093,7 +1085,6 @@ namespace Svg
public SvgElement BeforeSibling;
}
#if Net4
//deriving class registers event actions and calls the actions if the event occurs
public interface ISvgEventCaller
{
@ -1108,7 +1099,6 @@ namespace Svg
void RegisterAction<T1, T2, T3, T4, T5, T6, T7, T8>(string rpcID, Action<T1, T2, T3, T4, T5, T6, T7, T8> action);
void UnregisterAction(string rpcID);
}
#endif
/// <summary>
/// Represents the state of the mouse at the moment the event occured.

Просмотреть файл

@ -334,17 +334,17 @@ namespace Svg
switch (state)
{
case FontParseState.fontStyle:
success = Enums.TryParse(part, out fontStyle);
success = Enum.TryParse(part, out fontStyle);
if (success) FontStyle = fontStyle;
state++;
break;
case FontParseState.fontVariant:
success = Enums.TryParse(part, out fontVariant);
success = Enum.TryParse(part, out fontVariant);
if (success) FontVariant = fontVariant;
state++;
break;
case FontParseState.fontWeight:
success = Enums.TryParse(part, out fontWeight);
success = Enum.TryParse(part, out fontWeight);
if (success) FontWeight = fontWeight;
state++;
break;

Просмотреть файл

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>aeefc0cc-6d17-439d-b8e0-53b713485e3b</ProjectGuid>
</PropertyGroup>
<PropertyGroup>
<NuProjPath Condition=" '$(NuProjPath)' == '' ">$(MSBuildExtensionsPath)\NuProj\</NuProjPath>
</PropertyGroup>
<Import Project="$(NuProjPath)\NuProj.props" Condition="Exists('$(NuProjPath)\NuProj.props')" />
<PropertyGroup Label="Configuration">
<Id>Svg</Id>
<Title>SVG Rendering Library</Title>
<Authors>davescriven,jvenema,owaits,ddpruitt,Ralf1108,Tebjan Halm,and others</Authors>
<Owners>vvvv.org</Owners>
<Summary>Open source library to load/save and render SVG vector graphics.</Summary>
<Description>Public fork of the C# SVG rendering library on codeplex: https://svg.codeplex.com/
This started out as a minor modification to enable the writing of proper SVG strings. But now after almost two years we have so many fixes and improvements that we decided to share our current codebase to the public in order to improve it even further.
So please feel free to fork it and open pull requests for any fix, improvement or feature you add.
License: Microsoft Public License: https://svg.codeplex.com/license</Description>
<ReleaseNotes>merged github pull requests</ReleaseNotes>
<ProjectUrl>https://github.com/svg-net/SVG</ProjectUrl>
<LicenseUrl>http://opensource.org/licenses/MS-PL.html</LicenseUrl>
<Copyright>Copyright © vvvv.org</Copyright>
<Tags>svg, vector graphics, rendering</Tags>
<GenerateSymbolPackage>false</GenerateSymbolPackage>
<Version>2.2.1</Version>
<RequireLicenseAcceptance>true</RequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Svg.csproj" />
</ItemGroup>
<Import Project="$(NuProjPath)\NuProj.targets" />
</Project>

Просмотреть файл

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Svg</id>
<version>$version$</version>
<title>SVG Rendering Library</title>
<authors>davescriven,jvenema,owaits,ddpruitt,Ralf1108,Tebjan Halm,and others</authors>
<owners>vvvv.org</owners>
<licenseUrl>http://opensource.org/licenses/MS-PL.html</licenseUrl>
<projectUrl>https://github.com/svg-net/SVG</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Public fork of the C# SVG rendering library on codeplex: https://svg.codeplex.com/
This started out as a minor modification to enable the writing of proper SVG strings. But now after almost two years we have so many fixes and improvements that we decided to share our current codebase to the public in order to improve it even further.
So please feel free to fork it and open pull requests for any fix, improvement or feature you add.
License: Microsoft Public License: https://svg.codeplex.com/license</description>
<summary>Open source library to load/save and render SVG vector graphics.</summary>
<releaseNotes>merged github pull requests</releaseNotes>
<tags>svg, vector graphics, rendering</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" targetFramework="" />
<frameworkAssembly assemblyName="System.Web" targetFramework="" />
<frameworkAssembly assemblyName="System.Xml" targetFramework="" />
<frameworkAssembly assemblyName="System.Drawing" targetFramework="" />
</frameworkAssemblies>
</metadata>
<files>
<file src="..\Source\bin\Release\Svg.dll" target="lib\Svg.dll" />
<file src="..\Source\bin\Release\Svg.pdb" target="lib\Svg.pdb" />
<file src="..\Source\bin\Release\Svg.XML" target="lib\Svg.XML" />
</files>
</package>

Просмотреть файл

@ -1,31 +1,177 @@
using System.Collections.Generic;
using System;
using System.Collections;
using System.Collections.Generic;
#if NETCORE
using System.Diagnostics.CodeAnalysis;
#endif
#nullable enable
namespace Svg;
public class SvgOptions
namespace Svg
{
public SvgOptions()
public class SvgOptions : IDictionary<string, string>, ICloneable
{
}
private readonly IDictionary<string, string> _properties;
private Dictionary<string, string> _entities;
public SvgOptions()
{
_properties = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
public SvgOptions(Dictionary<string, string> entities)
{
Entities = entities;
}
public SvgOptions(Dictionary<string, string> entities)
: this()
{
_entities = entities;
}
public SvgOptions(Dictionary<string, string> entities, string css)
{
Entities = entities;
Css = css;
}
public SvgOptions(Dictionary<string, string> entities, string css)
: this()
{
_entities = entities;
this.SetValue(nameof(Css), css);
}
public SvgOptions(string css)
{
Css = css;
}
public SvgOptions(string css)
: this()
{
this.SetValue(nameof(Css), css);
}
public Dictionary<string, string>? Entities { get; set; }
public string? Css { get; set; }
public Dictionary<string, string> Entities {
get => _entities;
set => _entities = value;
}
public string Css {
get => this.GetValue(nameof(Css));
set => this.SetValue(nameof(Css), value);
}
public string this[string key]
{
get => this.GetValue(key, string.Empty);
set => this.SetValue(key, value);
}
public ICollection<string> Keys => _properties.Keys;
public ICollection<string> Values => _properties.Values;
public int Count => _properties.Count;
public bool IsReadOnly => _properties.IsReadOnly;
public void Add(string key, string value)
{
if (key != null)
{
_properties.Add(key, value);
}
}
public void Add(KeyValuePair<string, string> item)
{
this.Add(item.Key, item.Value);
}
public void Clear()
{
_properties.Clear();
}
public bool Contains(KeyValuePair<string, string> item)
{
return _properties.Contains(item);
}
public bool ContainsKey(string key)
{
return _properties.ContainsKey(key);
}
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
{
_properties.CopyTo(array, arrayIndex);
}
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return _properties.GetEnumerator();
}
public bool Remove(string key)
{
return _properties.Remove(key);
}
public bool Remove(KeyValuePair<string, string> item)
{
return _properties.Remove(item);
}
#if NETCORE
public bool TryGetValue(string key, [MaybeNullWhen(false)] out string value)
{
return _properties.TryGetValue(key, out value);
}
#else
public bool TryGetValue(string key, out string value)
{
return _properties.TryGetValue(key, out value);
}
#endif
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable)_properties).GetEnumerator();
}
object ICloneable.Clone()
{
return this.Clone();
}
public SvgOptions Clone()
{
SvgOptions options = new SvgOptions();
foreach (KeyValuePair<string, string> item in _properties)
{
options.Add(item);
}
if (_entities != null)
{
Dictionary<string, string> entities = new Dictionary<string, string>();
foreach (KeyValuePair<string, string> item in _entities)
{
entities.Add(item.Key, item.Value);
}
options._entities = entities;
}
return options;
}
protected string GetValue(string key, string defaultVal = null)
{
if (string.IsNullOrWhiteSpace(key))
{
return defaultVal;
}
if (_properties.TryGetValue(key, out string value))
{
return value;
}
return defaultVal;
}
protected void SetValue(string key, string value)
{
if (string.IsNullOrWhiteSpace(key))
{
return;
}
_properties[key] = value;
}
}
}

Просмотреть файл

@ -287,7 +287,6 @@ namespace Svg
}
}
#if Net4
public override void RegisterEvents(ISvgEventCaller caller)
{
//register basic events
@ -305,7 +304,6 @@ namespace Svg
//unregister change event
caller.UnregisterAction(this.ID + "/onchange");
}
#endif
public override SvgElement DeepCopy<T>()
{

Просмотреть файл

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Trace and Test Impact" id="23149ffc-ac6c-4c10-b846-c450c14dcd05" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are test settings for Trace and Test Impact.</Description>
<Execution>
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
</TestSettings>

Просмотреть файл

@ -1,69 +1,69 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--Svg Custom Project so that the NO_SDC is detected as used and not optimized away or broken. The original csproj is found here. -->
<!-- https://github.com/wieslawsoltes/Svg.Skia/blob/master/src/Svg.Custom/Svg.Custom.csproj -->
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
<EnableDefaultItems>False</EnableDefaultItems>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<NoWarn>CS1591;SYSLIB0014</NoWarn>
<IsPackable>True</IsPackable>
<Nullable>disable</Nullable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)\$(TargetFramework)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
<DefineConstants>$(DefineConstants);NO_SDC</DefineConstants>
<LangVersion>10.0</LangVersion>
</PropertyGroup>
<!--Svg Custom Project so that the NO_SDC is detected as used and not optimized away or broken. The original csproj is found here. -->
<!-- https://github.com/wieslawsoltes/Svg.Skia/blob/master/src/Svg.Custom/Svg.Custom.csproj -->
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
<EnableDefaultItems>False</EnableDefaultItems>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<NoWarn>CS1591;SYSLIB0014</NoWarn>
<IsPackable>True</IsPackable>
<Nullable>disable</Nullable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)\$(TargetFramework)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
<DefineConstants>$(DefineConstants);NO_SDC</DefineConstants>
<LangVersion>10.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<Description>Custom build of the SVG rendering library.</Description>
<PackageId>Svg.Custom</PackageId>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<PackageTags>svg;vector graphics;rendering;2d;graphics;geometry;shapes</PackageTags>
</PropertyGroup>
<PropertyGroup>
<Description>Custom build of the SVG rendering library.</Description>
<PackageId>Svg.Custom</PackageId>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<PackageTags>svg;vector graphics;rendering;2d;graphics;geometry;shapes</PackageTags>
</PropertyGroup>
<PropertyGroup>
<SvgSourcesBasePath>..</SvgSourcesBasePath>
</PropertyGroup>
<ItemGroup>
<!-- https://github.com/vvvv/SVG/blob/master/Source/SvgDtdResolver.cs#L32 -->
<EmbeddedResource Include="$(SvgSourcesBasePath)\Source\Resources\svg11.dtd">
<Link>Resources\svg11.dtd</Link>
<LogicalName>Svg.Resources.svg11.dtd</LogicalName>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<SvgSourcesBasePath>..</SvgSourcesBasePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" Exclude="bin\**;obj\**" />
<Compile Include="$(SvgSourcesBasePath)\Source\**\*.cs" Exclude="$(SvgSourcesBasePath)\Source\obj\**" />
<Compile Remove="$(SvgSourcesBasePath)\Source\Properties\AssemblyInfo.cs" />
<Compile Remove="$(SvgSourcesBasePath)\Source\Resources\svg11.dtd" />
</ItemGroup>
<ItemGroup>
<!-- https://github.com/vvvv/SVG/blob/master/Source/SvgDtdResolver.cs#L32 -->
<EmbeddedResource Include="$(SvgSourcesBasePath)\Source\Resources\svg11.dtd">
<Link>Resources\svg11.dtd</Link>
<LogicalName>Svg.Resources.svg11.dtd</LogicalName>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD20</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" Exclude="bin\**;obj\**" />
<Compile Include="$(SvgSourcesBasePath)\Source\**\*.cs" Exclude="$(SvgSourcesBasePath)\Source\obj\**" />
<Compile Remove="$(SvgSourcesBasePath)\Source\Properties\AssemblyInfo.cs" />
<Compile Remove="$(SvgSourcesBasePath)\Source\Resources\svg11.dtd" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<DefineConstants>$(DefineConstants);NETCORE;NET6</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD20</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<DefineConstants>$(DefineConstants);NETCORE;NET6</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ExCSS" Version="4.2.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);USE_SOURCE_GENERATORS</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ExCSS" Version="4.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SvgSourcesBasePath)\Generators\Svg.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);USE_SOURCE_GENERATORS</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(SvgSourcesBasePath)\Generators\Svg.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,45 +1,52 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;netcoreapp3.1;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>8.0</LangVersion>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\Svg.UnitTests\svgkey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;netcoreapp3.1;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>8.0</LangVersion>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\Svg.UnitTests\svgkey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="..\Issues\svg\__AJ_Digital_Camera.svg">
<Link>Assets\__AJ_Digital_Camera.svg</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\Issues\svg\__issue-134-01.svg">
<Link>Assets\__issue-134-01.svg</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\Issues\svg\__tiger.svg">
<Link>Assets\__tiger.svg</Link>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\Issues\svg\__AJ_Digital_Camera.svg">
<Link>Assets\__AJ_Digital_Camera.svg</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\Issues\svg\__issue-134-01.svg">
<Link>Assets\__issue-134-01.svg</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\Issues\svg\__tiger.svg">
<Link>Assets\__tiger.svg</Link>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
<ProjectReference Include="..\Svg.UnitTests\Svg.UnitTests.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
<ProjectReference Include="..\Svg.UnitTests\Svg.UnitTests.csproj" />
</ItemGroup>
<ItemGroup>
<None Remove="BenchmarkDotNet.Artifacts\**" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<None Remove="BenchmarkDotNet.Artifacts\**" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,55 +1,72 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsTestProject>true</IsTestProject>
<TargetFrameworks>net6.0;netcoreapp3.1;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>svgkey.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<IsTestProject>true</IsTestProject>
<TargetFrameworks>net6.0;netcoreapp3.1;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>svgkey.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Issue204_PrivateFont\BrushScriptMT2.ttf" />
<EmbeddedResource Include="AllTests.csv" />
<EmbeddedResource Include="PassingTests.csv" />
<None Include="svgkey.snk" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Issue204_PrivateFont\Text.svg" />
<EmbeddedResource Include="Resources\Issue210_Metafile\3DSceneSnapshotBIG.svg" />
<EmbeddedResource Include="Resources\Issue212_MakerEnd\OperatingPlan.svg" />
<EmbeddedResource Include="Resources\Issue_Multirender\TestFile.svg" />
<EmbeddedResource Include="Resources\Issue225_LargeUri\Speedometer.svg" />
<EmbeddedResource Include="Resources\hotfix-image-data-uri\Speedometer.svg" />
<EmbeddedResource Include="Resources\Issue_TextElement\Text.svg" />
<EmbeddedResource Include="Resources\Issue281_Bounds\BoundsTest.svg" />
<EmbeddedResource Include="Resources\Issue_Threading\TestFile.svg" />
<EmbeddedResource Include="Resources\Issue508_DashArray\DashArray.svg" />
<EmbeddedResource Include="Resources\Issue399_LexerIssue\LexerTestTemplate.svg" />
<EmbeddedResource Include="Resources\Issue399_LexerIssue\EmptyDTag.svg" />
<EmbeddedResource Include="Resources\Issue518_Entities\Entities.svg" />
<EmbeddedResource Include="Resources\ScriptTag\TestFile.svg" />
</ItemGroup>
<PropertyGroup>
<DefineConstants Condition="$(TargetFramework.StartsWith('net46'))">$(DefineConstants);DOTNET46;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net47'))">$(DefineConstants);DOTNET47;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net48'))">$(DefineConstants);DOTNET48;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netstandard'))">$(DefineConstants);NETSTANDARD</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netcore'))">$(DefineConstants);NETCORE</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6'))">$(DefineConstants);NETCORE;NETNEXT</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net7'))">$(DefineConstants);NETCORE;NETNEXT</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net8'))">$(DefineConstants);NETCORE;NETNEXT</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="NUnit" Version="3.13.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Fizzler" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Issue204_PrivateFont\BrushScriptMT2.ttf" />
<EmbeddedResource Include="AllTests.csv" />
<EmbeddedResource Include="PassingTests.csv" />
<None Include="svgkey.snk" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Issue204_PrivateFont\Text.svg" />
<EmbeddedResource Include="Resources\Issue210_Metafile\3DSceneSnapshotBIG.svg" />
<EmbeddedResource Include="Resources\Issue212_MakerEnd\OperatingPlan.svg" />
<EmbeddedResource Include="Resources\Issue_Multirender\TestFile.svg" />
<EmbeddedResource Include="Resources\Issue225_LargeUri\Speedometer.svg" />
<EmbeddedResource Include="Resources\hotfix-image-data-uri\Speedometer.svg" />
<EmbeddedResource Include="Resources\Issue_TextElement\Text.svg" />
<EmbeddedResource Include="Resources\Issue281_Bounds\BoundsTest.svg" />
<EmbeddedResource Include="Resources\Issue_Threading\TestFile.svg" />
<EmbeddedResource Include="Resources\Issue508_DashArray\DashArray.svg" />
<EmbeddedResource Include="Resources\Issue399_LexerIssue\LexerTestTemplate.svg" />
<EmbeddedResource Include="Resources\Issue399_LexerIssue\EmptyDTag.svg" />
<EmbeddedResource Include="Resources\Issue518_Entities\Entities.svg" />
<EmbeddedResource Include="Resources\ScriptTag\TestFile.svg" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="NUnit" Version="3.13.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Fizzler" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<Reference Include="WindowsBase" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,36 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;netcoreapp3.1;net462</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;netcoreapp3.1;net462</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="$(TargetFramework.StartsWith('net46'))">$(DefineConstants);DOTNET46;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net47'))">$(DefineConstants);DOTNET47;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net48'))">$(DefineConstants);DOTNET48;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netstandard'))">$(DefineConstants);NETSTANDARD</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netcore'))">$(DefineConstants);NETCORE</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6'))">$(DefineConstants);NETNEXT;NET60</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net7'))">$(DefineConstants);NETNEXT;NET70</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net8'))">$(DefineConstants);NETNEXT;NET80</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>$(NoWarn);CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<NoWarn>$(NoWarn);CS1591;CS0618;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net462'">
<Reference Include="System.Design" />
<Reference Include="System.Net.Http" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
<PropertyGroup>
<DefineConstants Condition="$(TargetFramework.StartsWith('net46'))">$(DefineConstants);DOTNET46;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net47'))">$(DefineConstants);DOTNET47;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net48'))">$(DefineConstants);DOTNET48;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netstandard'))">$(DefineConstants);NETSTANDARD</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('netcore'))">$(DefineConstants);NETCORE</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6'))">$(DefineConstants);NETNEXT;NET60</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net7'))">$(DefineConstants);NETNEXT;NET70</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net8'))">$(DefineConstants);NETNEXT;NET80</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net462'">
<Reference Include="System.Design" />
<Reference Include="System.Net.Http" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\Svg.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
</Project>