File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
src/Avalonia.Controls/Platform Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ public class PlatformScreen(IPlatformHandle platformHandle) : Screen
27
27
public override IPlatformHandle ? TryGetPlatformHandle ( ) => platformHandle ;
28
28
29
29
public override int GetHashCode ( ) => platformHandle . GetHashCode ( ) ;
30
- public override bool Equals ( object ? obj )
30
+
31
+ public override bool Equals ( Screen ? obj )
31
32
{
32
33
return obj is PlatformScreen other && platformHandle . Equals ( other . TryGetPlatformHandle ( ) ! ) ;
33
34
}
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . ComponentModel ;
3
+ using System . Runtime . CompilerServices ;
3
4
using Avalonia . Diagnostics ;
4
5
using Avalonia . Metadata ;
5
6
using Avalonia . Utilities ;
@@ -122,13 +123,19 @@ private protected Screen() { }
122
123
/// </returns>
123
124
public virtual IPlatformHandle ? TryGetPlatformHandle ( ) => null ;
124
125
126
+ // TODO12: make abstract
127
+ /// <inheritdoc />
128
+ public override int GetHashCode ( )
129
+ => RuntimeHelpers . GetHashCode ( this ) ;
130
+
131
+ /// <inheritdoc />
132
+ public override bool Equals ( object ? obj )
133
+ => obj is Screen other && Equals ( other ) ;
134
+
135
+ // TODO12: make abstract
125
136
/// <inheritdoc/>
126
- public bool Equals ( Screen ? other )
127
- {
128
- if ( other is null ) return false ;
129
- if ( ReferenceEquals ( this , other ) ) return true ;
130
- return base . Equals ( other ) ;
131
- }
137
+ public virtual bool Equals ( Screen ? other )
138
+ => ReferenceEquals ( this , other ) ;
132
139
133
140
public static bool operator == ( Screen ? left , Screen ? right )
134
141
{
You can’t perform that action at this time.
0 commit comments