Files
mpv.net/src/MpvNet/AppInfo.cs
2023-10-24 11:17:45 +02:00

12 lines
383 B
C#

using System.Reflection;
namespace MpvNet;
public static class AppInfo
{
public static string Product => GetAssemblyAttribute<AssemblyProductAttribute>().Product;
public static Version Version => Assembly.GetEntryAssembly()!.GetName().Version!;
static T GetAssemblyAttribute<T>() => (T)(object)Assembly.GetEntryAssembly()!.GetCustomAttributes(typeof(T)).First();
}