EnumExtension class to new file
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/HardwareWallets/ConnectHardwareWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/HardwareWallets/ConnectHardwareWalletViewModel.cs
@@ -17,6 +17,7 @@ using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Extensions;
using WalletWasabi.Gui.Controls.WalletExplorer;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Models.StatusBarStatuses;

MODIFY
WalletWasabi.Tests/UnitTests/WalletDirTests.cs
WalletWasabi.Tests/UnitTests/WalletDirTests.cs
@@ -2,8 +2,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using System.Text;
using System.Threading.Tasks;
+using WalletWasabi.Extensions;
using WalletWasabi.Helpers;
using WalletWasabi.Hwi.Models;
using WalletWasabi.Wallets;

ADD
WalletWasabi/Extensions/EnumExtension.cs
+using System;
+using System.ComponentModel;
+using System.Linq;
+
+namespace WalletWasabi.Extensions
+{
+ public static class EnumExtensions
+ {
+ public static T? GetFirstAttribute<T>(this Enum value) where T : Attribute
+ {
+ var type = value.GetType();
+ var memberInfo = type.GetMember(value.ToString());
+ var attributes = memberInfo[0].GetCustomAttributes(typeof(T), false);
+
+ return attributes.Any() ? (T)attributes[0] : null;
+ }
+
+ public static string FriendlyName(this Enum value)
+ {
+ var attribute = value.GetFirstAttribute<DescriptionAttribute>();
+
+ return attribute is { } ? attribute.Description : value.ToString();
+ }
+ }
+}

MODIFY
WalletWasabi/Hwi/Models/HardwareWalletModels.cs
WalletWasabi/Hwi/Models/HardwareWalletModels.cs
-using System;
using System.ComponentModel;
-using System.Linq;
namespace WalletWasabi.Hwi.Models
{
@@ -51,23 +49,4 @@ namespace WalletWasabi.Hwi.Models
[Description("BitBox")]
BitBox02_Multi,
}
-
- public static class EnumExtensions
- {
- public static T? GetFirstAttribute<T>(this Enum value) where T : Attribute
- {
- var type = value.GetType();
- var memberInfo = type.GetMember(value.ToString());
- var attributes = memberInfo[0].GetCustomAttributes(typeof(T), false);
-
- return attributes.Any() ? (T)attributes[0] : null;
- }
-
- public static string FriendlyName(this Enum value)
- {
- var attribute = value.GetFirstAttribute<DescriptionAttribute>();
-
- return attribute is { } ? attribute.Description : value.ToString();
- }
- }
}

EnumExtension class to new file