ExtensionObject`1.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 namespace Microsoft.CmdPal.Core.ViewModels.Models; 6 7 public class ExtensionObject<T>(T? value) // where T : IInspectable 8 { 9 public T? Unsafe { get; } = value; 10 11 public override bool Equals(object? obj) => obj is ExtensionObject<T> ext && ext.Unsafe?.Equals(this.Unsafe) == true; 12 13 public override int GetHashCode() => Unsafe?.GetHashCode() ?? base.GetHashCode(); 14 }