Julien Lebosquain
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
15 additions and
7 deletions
-
src/Avalonia.Controls/Platform/IScreenImpl.cs
-
src/Avalonia.Controls/Platform/Screen.cs
|
|
|
@ -27,7 +27,8 @@ namespace Avalonia.Platform |
|
|
|
public override IPlatformHandle? TryGetPlatformHandle() => platformHandle; |
|
|
|
|
|
|
|
public override int GetHashCode() => platformHandle.GetHashCode(); |
|
|
|
public override bool Equals(object? obj) |
|
|
|
|
|
|
|
public override bool Equals(Screen? obj) |
|
|
|
{ |
|
|
|
return obj is PlatformScreen other && platformHandle.Equals(other.TryGetPlatformHandle()!); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
using System; |
|
|
|
using System.ComponentModel; |
|
|
|
using System.Runtime.CompilerServices; |
|
|
|
using Avalonia.Diagnostics; |
|
|
|
using Avalonia.Metadata; |
|
|
|
using Avalonia.Utilities; |
|
|
|
@ -122,13 +123,19 @@ namespace Avalonia.Platform |
|
|
|
/// </returns>
|
|
|
|
public virtual IPlatformHandle? TryGetPlatformHandle() => null; |
|
|
|
|
|
|
|
// TODO12: make abstract
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override int GetHashCode() |
|
|
|
=> RuntimeHelpers.GetHashCode(this); |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override bool Equals(object? obj) |
|
|
|
=> obj is Screen other && Equals(other); |
|
|
|
|
|
|
|
// TODO12: make abstract
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public bool Equals(Screen? other) |
|
|
|
{ |
|
|
|
if (other is null) return false; |
|
|
|
if (ReferenceEquals(this, other)) return true; |
|
|
|
return base.Equals(other); |
|
|
|
} |
|
|
|
public virtual bool Equals(Screen? other) |
|
|
|
=> ReferenceEquals(this, other); |
|
|
|
|
|
|
|
public static bool operator ==(Screen? left, Screen? right) |
|
|
|
{ |
|
|
|
|