show current version and hash in new ui footer

This commit is contained in:
LukeFZ
2025-07-29 18:56:49 +02:00
parent 5d92ceb2f3
commit 62a27ee47f
7 changed files with 52 additions and 8 deletions

View File

@@ -0,0 +1,26 @@
using System.Reflection;
namespace Il2CppInspector.Redux.GUI;
public static class Extensions
{
public static bool GetAsBooleanOrDefault(this Dictionary<string, string> dict, string key, bool defaultValue)
{
if (dict.TryGetValue(key, out var value) && bool.TryParse(value, out var boolResult))
return boolResult;
return defaultValue;
}
public static T GetAsEnumOrDefault<T>(this Dictionary<string, string> dict, string key, T defaultValue)
where T : struct, Enum
{
if (dict.TryGetValue(key, out var value) && Enum.TryParse<T>(value, true, out var enumResult))
return enumResult;
return defaultValue;
}
public static string? GetAssemblyVersion(this Assembly assembly)
=> assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
}