Skip to content

Commit

Permalink
Release 5.1.1 (#91)
Browse files Browse the repository at this point in the history
* Bug fixes and code improvements

- Fixed the issue #89
- Removed the private ControlLine class (no longer used as path is parsed with WPF parser)
- Add IsDefault property to Fill and Stroke to make default fills and strokes known
- Eliminated the 135, warning CA1416: This call site is reachable on all platforms.
- Eliminated some "as" casts, with the new "is" syntax.

* Updated Version Information
  • Loading branch information
paulushub authored Dec 24, 2023
1 parent 545f36f commit eb6eff9
Show file tree
Hide file tree
Showing 23 changed files with 308 additions and 151 deletions.
10 changes: 5 additions & 5 deletions Docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ The respository includes
* **Samples:** For sample applications
* **Docs:** For the documentations (in markdown format).

The command lines installation options are: For the version `5.1.0`
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.1.0
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.1.0
The command lines installation options are: For the version `5.1.1`
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.1.1
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.1.1

For reference in projects use: For the version `5.1.0`
For reference in projects use: For the version `5.1.1`
```xml
<PackageReference Include="DotNetProjects.SVGImage" Version="5.1.0" />
<PackageReference Include="DotNetProjects.SVGImage" Version="5.1.1" />
```

## How to build
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
next-version: 5.1.0
next-version: 5.1.1
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ The respository includes
* **Samples:** For sample applications
* **Docs:** For the documentations (in markdown format).

The command lines installation options are: For the version `5.1.0`
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.1.0
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.1.0
The command lines installation options are: For the version `5.1.1`
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.1.1
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.1.1

For reference in projects use: For the version `5.1.0`
For reference in projects use: For the version `5.1.1`
```xml
<PackageReference Include="DotNetProjects.SVGImage" Version="5.1.0" />
<PackageReference Include="DotNetProjects.SVGImage" Version="5.1.1" />
```

## How to build
Expand Down
11 changes: 11 additions & 0 deletions Samples/ClipArtViewer/ClipArtViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
<PropertyGroup>
<ApplicationIcon>ClipArtViewer.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" '$(TargetFramework)' == 'net40' ">$(DefineConstants);DOTNET40;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net45'))">$(DefineConstants);DOTNET45;NETFULL</DefineConstants>
<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('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>
<ProjectReference Include="..\..\Source\SVGImage\DotNetProjects.SVGImage.csproj" />
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions Samples/ClipArtViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
using System.Runtime.InteropServices;
using System.Windows;

#if NETNEXT
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows7.0")]
#endif

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
Expand Down
11 changes: 11 additions & 0 deletions Samples/CustomBrushesExample/CustomBrushesExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
<PropertyGroup>
<ApplicationIcon>CustomBrushesExample.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" '$(TargetFramework)' == 'net40' ">$(DefineConstants);DOTNET40;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net45'))">$(DefineConstants);DOTNET45;NETFULL</DefineConstants>
<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('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>
<ProjectReference Include="..\..\Source\SVGImage\DotNetProjects.SVGImage.csproj" />
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions Samples/CustomBrushesExample/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
using System.Runtime.InteropServices;
using System.Windows;

#if NETNEXT
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows7.0")]
#endif

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
Expand Down
4 changes: 4 additions & 0 deletions Samples/Example/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
using System.Runtime.InteropServices;
using System.Windows;

#if NETNEXT
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows7.0")]
#endif

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
Expand Down
4 changes: 4 additions & 0 deletions Samples/IconConverterSample/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
using System.Runtime.InteropServices;
using System.Windows;

#if NETNEXT
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows7.0")]
#endif

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
Expand Down
8 changes: 4 additions & 4 deletions Source/SVGImage/DotNetProjects.SVGImage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<Product>DotNetProjects.SVGImage</Product>
<Copyright>2020-2023 DotNetProjects</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<AssemblyVersion>5.1.0.0</AssemblyVersion>
<FileVersion>5.1.0.0</FileVersion>
<Version>5.1.0</Version>
<AssemblyVersion>5.1.1.0</AssemblyVersion>
<FileVersion>5.1.1.0</FileVersion>
<Version>5.1.1</Version>
<OutputType>Library</OutputType>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand All @@ -31,7 +31,7 @@
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<EnablePackageValidation>true</EnablePackageValidation>
<!-- NOTE: Detect breaking changes from a previous version -->
<PackageValidationBaselineVersion>5.0.118</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>5.1.0</PackageValidationBaselineVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
4 changes: 4 additions & 0 deletions Source/SVGImage/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
using System.Windows;
using System.Windows.Markup;

#if NETNEXT
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows7.0")]
#endif

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
Expand Down
63 changes: 57 additions & 6 deletions Source/SVGImage/SVG/Fill.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media;

namespace SVGImage.SVG
Expand All @@ -14,16 +15,66 @@ public enum eFillRule
evenodd
}

public eFillRule FillRule { get; set;}
private SVG _svg;

public string PaintServerKey {get; set;}
private bool _isDefault;

public double Opacity {get; set;}
private eFillRule _fillRule;

private string _paintServerKey;

private double _opacity;

public Fill(SVG svg)
{
this.FillRule = eFillRule.nonzero;
this.Opacity = 100;
_fillRule = eFillRule.nonzero;
_opacity = 100;
_isDefault = false;
_svg = svg;
}

public static Fill CreateDefault(SVG svg, string fillColor)
{
var fill = new Fill(svg);
fill.PaintServerKey = svg.PaintServers.Parse(fillColor);

fill._isDefault = true;

return fill;
}

public SVG get => _svg;

public bool IsDefault
{
get => _isDefault;
set => _isDefault = value;
}

public eFillRule FillRule {
get => _fillRule;
set {
Debug.Assert(_isDefault == false);
_fillRule = value;
}
}

public string PaintServerKey
{
get => _paintServerKey;
set {
Debug.Assert(_isDefault == false);
_paintServerKey = value;
}
}

public double Opacity
{
get => _opacity;
set {
Debug.Assert(_isDefault == false);
_opacity = value;
}
}

public bool IsEmpty(SVG svg)
Expand Down
3 changes: 2 additions & 1 deletion Source/SVGImage/SVG/PaintServers/PaintServerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ private string ParseKnownColor(string value)

private static void LoadKnownColors()
{
if (m_knownColors == null) m_knownColors = new Dictionary<string, Color>();
if (m_knownColors == null)
m_knownColors = new Dictionary<string, Color>(StringComparer.OrdinalIgnoreCase);
if (m_knownColors.Count == 0)
{
PropertyInfo[] propinfos = typeof(Colors).GetProperties(BindingFlags.Public | BindingFlags.Static);
Expand Down
Loading

0 comments on commit eb6eff9

Please sign in to comment.