Skip to content

Commit a314432

Browse files
committed
Remove System.Drawing.Common
1 parent 1fb96d2 commit a314432

File tree

12 files changed

+18
-28
lines changed

12 files changed

+18
-28
lines changed

AdvancedSharpAdbClient.Tests/AdbClientTests.Async.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Drawing;
4-
using System.Drawing.Imaging;
53
using System.Globalization;
64
using System.IO;
75
using System.Linq;
@@ -367,7 +365,7 @@ await File.ReadAllBytesAsync("Assets/Framebuffer.bin")
367365
Assert.Equal(1u, header.Version);
368366
Assert.Equal(0u, header.ColorSpace);
369367

370-
#if WINDOWS
368+
#if HAS_IMAGING
371369
if (!OperatingSystem.IsWindows()) { return; }
372370

373371
using Bitmap image = framebuffer.ToImage();

AdvancedSharpAdbClient.Tests/AdbClientTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Drawing;
4-
using System.Drawing.Imaging;
53
using System.Globalization;
64
using System.IO;
75
using System.Linq;
@@ -489,7 +487,7 @@ public void GetFrameBufferTest()
489487
Assert.Equal(1u, header.Version);
490488
Assert.Equal(0u, header.ColorSpace);
491489

492-
#if WINDOWS
490+
#if HAS_IMAGING
493491
if (!OperatingSystem.IsWindows()) { return; }
494492

495493
using Bitmap image = framebuffer.ToImage();

AdvancedSharpAdbClient.Tests/AdvancedSharpAdbClient.Tests.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
<LangVersion>latest</LangVersion>
55
<NoWarn>$(NoWarn);CS1591</NoWarn>
66
</PropertyGroup>
7-
7+
88
<Choose>
99
<When Condition="'$(IsWindows)' == 'True' and '$(IsStandard)' != 'True'">
1010
<PropertyGroup>
11-
<TargetFramework>net8.0-windows10.0.18362.0</TargetFramework>
12-
<WindowsSdkPackageVersion>10.0.18362.42</WindowsSdkPackageVersion>
11+
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
1312
</PropertyGroup>
1413
</When>
1514
<Otherwise>
@@ -40,5 +39,9 @@
4039
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4140
</None>
4241
</ItemGroup>
42+
43+
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net1.1'))">
44+
<DefineConstants>$(DefineConstants);HAS_IMAGING</DefineConstants>
45+
</PropertyGroup>
4346

4447
</Project>

AdvancedSharpAdbClient.Tests/DeviceCommands/Receivers/GetPropReceiverTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void ListPropertiesTest()
1414
};
1515

1616
DummyAdbClient client = new();
17-
client.Commands["shell:/system/bin/getprop"] =
17+
client.Commands["shell:/system/bin/getprop"] =
1818
"""
1919
[init.svc.BGW]: [running]
2020
[init.svc.MtkCodecService]: [running]

AdvancedSharpAdbClient.Tests/Dummys/DummyAdbSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace AdvancedSharpAdbClient.Tests
1111
/// <summary>
1212
/// A mock implementation of the <see cref="IAdbSocket"/> class.
1313
/// </summary>
14-
internal class DummyAdbSocket : IDummyAdbSocket, ICloneable<DummyAdbSocket>
14+
internal partial class DummyAdbSocket : IDummyAdbSocket, ICloneable<DummyAdbSocket>
1515
{
1616
/// <summary>
1717
/// Use this message to cause <see cref="ReadString"/> and <see cref="ReadStringAsync(CancellationToken)"/> to throw

AdvancedSharpAdbClient.Tests/Dummys/DummySyncService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace AdvancedSharpAdbClient.Tests
99
/// <summary>
1010
/// A mock implementation of the <see cref="ISyncService"/> class.
1111
/// </summary>
12-
internal class DummySyncService : ISyncService
12+
internal partial class DummySyncService : ISyncService
1313
{
1414
public Dictionary<string, Stream> UploadedFiles { get; } = [];
1515

AdvancedSharpAdbClient.Tests/Dummys/DummyTcpSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace AdvancedSharpAdbClient.Tests
1010
/// <summary>
1111
/// A mock implementation of the <see cref="ITcpSocket"/> class.
1212
/// </summary>
13-
internal class DummyTcpSocket : ITcpSocket, ICloneable<DummyTcpSocket>
13+
internal partial class DummyTcpSocket : ITcpSocket, ICloneable<DummyTcpSocket>
1414
{
1515
/// <summary>
1616
/// The stream from which the <see cref="DummyTcpSocket"/> reads.

AdvancedSharpAdbClient.Tests/Dummys/TracingAdbSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace AdvancedSharpAdbClient.Tests
1010
{
11-
internal class TracingAdbSocket(EndPoint endPoint) : AdbSocket(endPoint), IDummyAdbSocket
11+
internal partial class TracingAdbSocket(EndPoint endPoint) : AdbSocket(endPoint), IDummyAdbSocket
1212
{
1313
private readonly EndPoint endPoint = endPoint;
1414

AdvancedSharpAdbClient.Tests/Extensions/FactoriesLocker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace AdvancedSharpAdbClient.Tests
77
/// <summary>
88
/// Locker for the <see cref="Factories"/> class.
99
/// </summary>
10-
public class FactoriesLocker : IDisposable
10+
public partial class FactoriesLocker : IDisposable
1111
{
1212
public static SemaphoreSlim SlimLocker { get; } = new(1, 1);
1313

AdvancedSharpAdbClient.Tests/Models/FramebufferHeaderTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Drawing;
3-
using System.Drawing.Imaging;
42
using System.IO;
53
using Xunit;
64

@@ -71,7 +69,7 @@ public void ReadFramebufferV2Test()
7169
Assert.Equal(data.AsSpan(), [.. header]);
7270
}
7371

74-
#if WINDOWS
72+
#if HAS_IMAGING
7573
[Fact]
7674
public void ToImageTest()
7775
{

0 commit comments

Comments
 (0)