1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-07 21:58:06 -05:00

25 lines
479 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SharedLibrary.Helpers
{
public class ParseEnum<T>
{
public static T Get(string e, Type type)
{
try
{
return (T)Enum.Parse(type, e);
}
catch (Exception)
{
return (T)(Enum.GetValues(type).GetValue(0));
}
}
}
}