Fixed ambiguous equals in Display

This commit is contained in:
Darth Affe 2022-05-02 22:21:10 +02:00
parent 2614596807
commit 2a4dbd8fe5
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,7 @@
// ReSharper disable MemberCanBePrivate.Global
using System;
namespace ScreenCapture.NET;
/// <summary>
@ -58,20 +60,20 @@ public readonly struct Display
#endregion
#region Methods
/// <summary>
/// Determines whether this <see cref="Display"/> equals the given one.
/// </summary>
/// <param name="other">The <see cref="Display"/> to compare.</param>
/// <returns><c>true</c> if the specified object is equal to the current object; otherwise, <c>false</c>.</returns>
public bool Equals(Display other) => Index == other.Index;
public bool Equals(Display other) => (Index == other.Index) && GraphicsCard.Equals(other.GraphicsCard);
/// <inheritdoc />
public override bool Equals(object? obj) => obj is Display other && Equals(other);
/// <inheritdoc />
public override int GetHashCode() => Index;
public override int GetHashCode() => HashCode.Combine(Index, GraphicsCard);
/// <summary>
/// Determines whether two <see cref="Display"/> are equal.
/// </summary>

View File

@ -26,8 +26,9 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageReleaseNotes>
- Added IScreenCapture.UpdateCaptureZone to modify existing CaptureZones without having to remove and add them again.
- Added IScreenCapture.UpdateCaptureZone to modify existing CaptureZones without having to remove and add them again.
(This has performance benefits when only X and/or Y is changed, changes to width, height and downscale are internally still reinitializing the zone.)
- Fixed ambiguous equals in Display
</PackageReleaseNotes>
<Version>1.2.0</Version>