mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
17 lines
373 B
C#
17 lines
373 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Mesen.Utilities
|
|
{
|
|
public static class EnumExtensions
|
|
{
|
|
public static T? GetAttribute<T>(this Enum val) where T : Attribute
|
|
{
|
|
return val.GetType().GetMember(val.ToString())[0].GetCustomAttribute<T>();
|
|
}
|
|
}
|
|
}
|