Skip to content

Commit 76d0ca4

Browse files
committed
Added support back for netstandard 2.1
1 parent 6f5d96c commit 76d0ca4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)','net5.0'))">
5151
<DefineConstants>$(DefineConstants);SUPPORTS_MEMBERNOTNULL</DefineConstants>
5252
<DefineConstants>$(DefineConstants);SUPPORTS_INIT</DefineConstants>
53+
<DefineConstants>$(DefineConstants);SUPPORTS_TYPED_ENUM_ISDEFINED</DefineConstants>
5354
</PropertyGroup>
5455

55-
</Project>
56+
</Project>

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33

44
<PropertyGroup>
5-
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
66
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props</MSBuildAllProjects>
77
<SynercodingProjectCategory>src</SynercodingProjectCategory>
88
</PropertyGroup>

src/Synercoding.FileFormats.Pdf/PdfPage.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ public PageRotation? Rotation
6060
get => _rotation;
6161
set
6262
{
63+
const string ARGUMENT_OUT_OF_RANGE_MESSAGE = "The provided value can only be increments of 90.";
64+
#if SUPPORTS_TYPED_ENUM_ISDEFINED
6365
if (value is not null && !Enum.IsDefined(value.Value))
64-
throw new ArgumentOutOfRangeException(nameof(Rotation), value, "The provided value can only be increments of 90.");
66+
throw new ArgumentOutOfRangeException(nameof(Rotation), value, ARGUMENT_OUT_OF_RANGE_MESSAGE);
67+
#else
68+
if (value is not null && !Enum.IsDefined(typeof(PageRotation), value.Value))
69+
throw new ArgumentOutOfRangeException(nameof(Rotation), value, ARGUMENT_OUT_OF_RANGE_MESSAGE);
70+
#endif
6571

6672
_rotation = value;
6773
}

0 commit comments

Comments
 (0)