Skip to content

Commit fd228af

Browse files
committed
Fixed small code issues
1 parent 1223275 commit fd228af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ScreenCapture.NET.DX11/DX11ScreenCapture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public sealed class DX11ScreenCapture : AbstractScreenCapture<ColorBGRA>
2424
#region Constants
2525

2626
private static readonly FeatureLevel[] FEATURE_LEVELS =
27-
{
27+
[
2828
FeatureLevel.Level_11_1,
2929
FeatureLevel.Level_11_0,
3030
FeatureLevel.Level_10_1,
3131
FeatureLevel.Level_10_0
32-
};
32+
];
3333

3434
#endregion
3535

@@ -54,7 +54,7 @@ public sealed class DX11ScreenCapture : AbstractScreenCapture<ColorBGRA>
5454
private ID3D11DeviceContext? _context;
5555
private ID3D11Texture2D? _captureTexture;
5656

57-
private readonly Dictionary<CaptureZone<ColorBGRA>, ZoneTextures> _textures = new();
57+
private readonly Dictionary<CaptureZone<ColorBGRA>, ZoneTextures> _textures = [];
5858

5959
#endregion
6060

ScreenCapture.NET/Model/CaptureZone.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private class UnlockDisposable : IDisposable
204204
/// <inheritdoc />
205205
public void Dispose()
206206
{
207-
if (_disposed) throw new ObjectDisposedException("The lock is already released");
207+
ObjectDisposedException.ThrowIf(_disposed, this);
208208

209209
Monitor.Exit(_lock);
210210
_disposed = true;

0 commit comments

Comments
 (0)