Skip to content

Commit fb4876e

Browse files
authored
Merge pull request #21 from DarthAffe/Net6Fixes
Net6 fixes
2 parents 5eb8b56 + f4ef78f commit fb4876e

File tree

14 files changed

+94
-26
lines changed

14 files changed

+94
-26
lines changed

ScreenCapture.NET.DX11/ScreenCapture.NET.DX11.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net7.0-windows;net6.0-windows</TargetFrameworks>
3+
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
4+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
45
<LangVersion>latest</LangVersion>
56
<Nullable>enable</Nullable>
67
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -28,9 +29,9 @@
2829
<PackageReleaseNotes>
2930
</PackageReleaseNotes>
3031

31-
<Version>2.0.0</Version>
32-
<AssemblyVersion>2.0.0</AssemblyVersion>
33-
<FileVersion>2.0.0</FileVersion>
32+
<Version>2.0.2</Version>
33+
<AssemblyVersion>2.0.2</AssemblyVersion>
34+
<FileVersion>2.0.2</FileVersion>
3435

3536
<OutputPath>..\bin\</OutputPath>
3637
<GenerateDocumentationFile>true</GenerateDocumentationFile>

ScreenCapture.NET.DX9/ScreenCapture.NET.DX9.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net7.0-windows;net6.0-windows</TargetFrameworks>
3+
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
4+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
45
<LangVersion>latest</LangVersion>
56
<Nullable>enable</Nullable>
67
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -28,9 +29,9 @@
2829
<PackageReleaseNotes>
2930
</PackageReleaseNotes>
3031

31-
<Version>2.0.0</Version>
32-
<AssemblyVersion>2.0.0</AssemblyVersion>
33-
<FileVersion>2.0.0</FileVersion>
32+
<Version>2.0.2</Version>
33+
<AssemblyVersion>2.0.2</AssemblyVersion>
34+
<FileVersion>2.0.2</FileVersion>
3435

3536
<OutputPath>..\bin\</OutputPath>
3637
<GenerateDocumentationFile>true</GenerateDocumentationFile>

ScreenCapture.NET.X11/ScreenCapture.NET.X11.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<PackageReleaseNotes>
3030
</PackageReleaseNotes>
3131

32-
<Version>2.0.0</Version>
33-
<AssemblyVersion>2.0.0</AssemblyVersion>
34-
<FileVersion>2.0.0</FileVersion>
32+
<Version>2.0.2</Version>
33+
<AssemblyVersion>2.0.2</AssemblyVersion>
34+
<FileVersion>2.0.2</FileVersion>
3535

3636
<OutputPath>..\bin\</OutputPath>
3737
<GenerateDocumentationFile>true</GenerateDocumentationFile>

ScreenCapture.NET/Model/CaptureZone.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,21 @@ public sealed class CaptureZone<TColor> : ICaptureZone
2020
/// <inheritdoc />
2121
public Display Display { get; }
2222

23+
#if NET7_0_OR_GREATER
2324
/// <inheritdoc />
2425
public ColorFormat ColorFormat
2526
{
2627
[MethodImpl(MethodImplOptions.AggressiveInlining)]
2728
get => TColor.ColorFormat;
2829
}
30+
#else
31+
/// <inheritdoc />
32+
public ColorFormat ColorFormat
33+
{
34+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
35+
get => default(TColor).Net6ColorFormat;
36+
}
37+
#endif
2938

3039
/// <inheritdoc />
3140
public int X { get; internal set; }
@@ -95,7 +104,7 @@ IImage ICaptureZone.Image
95104
/// <inheritdoc />
96105
public bool IsUpdateRequested { get; private set; }
97106

98-
#endregion
107+
#endregion
99108

100109
#region Events
101110

ScreenCapture.NET/Model/Colors/ColorABGR.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ namespace ScreenCapture.NET;
1717
/// <inheritdoc />
1818
public static ColorFormat ColorFormat => ColorFormat.ABGR;
1919

20+
#if !NET7_0_OR_GREATER
21+
/// <inheritdoc />
22+
public ColorFormat Net6ColorFormat => ColorFormat;
23+
#endif
24+
2025
private readonly byte _a;
2126
private readonly byte _b;
2227
private readonly byte _g;
@@ -39,7 +44,7 @@ namespace ScreenCapture.NET;
3944
#endregion
4045

4146
#region Constructors
42-
47+
4348
/// <summary>
4449
/// Initializes a new instance of the <see cref="ColorABGR"/> class.
4550
/// </summary>

ScreenCapture.NET/Model/Colors/ColorARGB.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313
public readonly struct ColorARGB : IColor
1414
{
1515
#region Properties & Fields
16-
16+
1717
/// <inheritdoc />
1818
public static ColorFormat ColorFormat => ColorFormat.ARGB;
1919

20+
#if !NET7_0_OR_GREATER
21+
/// <inheritdoc />
22+
public ColorFormat Net6ColorFormat => ColorFormat;
23+
#endif
24+
2025
private readonly byte _a;
2126
private readonly byte _r;
2227
private readonly byte _g;

ScreenCapture.NET/Model/Colors/ColorBGR.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313
public readonly struct ColorBGR : IColor
1414
{
1515
#region Properties & Fields
16-
16+
1717
/// <inheritdoc />
1818
public static ColorFormat ColorFormat => ColorFormat.BGR;
1919

20+
#if !NET7_0_OR_GREATER
21+
/// <inheritdoc />
22+
public ColorFormat Net6ColorFormat => ColorFormat;
23+
#endif
24+
2025
private readonly byte _b;
2126
private readonly byte _g;
2227
private readonly byte _r;

ScreenCapture.NET/Model/Colors/ColorBGRA.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313
public readonly struct ColorBGRA : IColor
1414
{
1515
#region Properties & Fields
16-
16+
1717
/// <inheritdoc />
1818
public static ColorFormat ColorFormat => ColorFormat.BGRA;
1919

20+
#if !NET7_0_OR_GREATER
21+
/// <inheritdoc />
22+
public ColorFormat Net6ColorFormat => ColorFormat;
23+
#endif
24+
2025
private readonly byte _b;
2126
private readonly byte _g;
2227
private readonly byte _r;
@@ -36,7 +41,7 @@ namespace ScreenCapture.NET;
3641
public byte A => _a;
3742
// ReSharper restore ConvertToAutoPropertyWhenPossible
3843

39-
#endregion
44+
#endregion
4045

4146
#region Constructors
4247

ScreenCapture.NET/Model/Colors/ColorRGB.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313
public readonly struct ColorRGB : IColor
1414
{
1515
#region Properties & Fields
16-
16+
1717
/// <inheritdoc />
1818
public static ColorFormat ColorFormat => ColorFormat.RGB;
1919

20+
#if !NET7_0_OR_GREATER
21+
/// <inheritdoc />
22+
public ColorFormat Net6ColorFormat => ColorFormat;
23+
#endif
24+
2025
private readonly byte _r;
2126
private readonly byte _g;
2227
private readonly byte _b;

ScreenCapture.NET/Model/Colors/ColorRGBA.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ namespace ScreenCapture.NET;
1717
/// <inheritdoc />
1818
public static ColorFormat ColorFormat => ColorFormat.RGBA;
1919

20+
#if !NET7_0_OR_GREATER
21+
/// <inheritdoc />
22+
public ColorFormat Net6ColorFormat => ColorFormat;
23+
#endif
24+
2025
private readonly byte _r;
2126
private readonly byte _g;
2227
private readonly byte _b;

0 commit comments

Comments
 (0)