/// <summary> /// Int to Enum /// </summary> /// <typeparam name="T">Type of Enum</typeparam> /// <param name="input">Int to Convert</param> /// <param name="defaultValue">Default value to return</param> /// <returns>Enum type of T</returns> public static T ParseEnum <T>(int input, T defaultValue) where T : struct => GenericParseEnum.ParseEnumExt(input, defaultValue);
/// <summary> /// String to Enum /// </summary> /// <typeparam name="T">Type of Enum</typeparam> /// <param name="inString">String to Convert</param> /// <param name="defaultValue">Default value to return</param> /// <param name="ignoreCase">true ignore case/ false not ignore</param> /// <returns>Enum type of T</returns> public static T ParseEnum <T>(string inString, T defaultValue, bool ignoreCase = true) where T : struct => GenericParseEnum.ParseEnumExt(inString, defaultValue, ignoreCase);
/// <summary> /// Int to Enum /// </summary> /// <typeparam name="T">Type of Enum</typeparam> /// <param name="input">Int to Convert</param> /// <returns>Enum type of T</returns> public static T ParseEnum <T>(int input) where T : struct => GenericParseEnum.ParseEnumExt <T>(input);
/// <summary> /// String to Enum /// </summary> /// <typeparam name="T">Type of Enum</typeparam> /// <param name="inString">String to Convert</param> /// <param name="ignoreCase">true ignore case/ false not ignore</param> /// <returns>Enum type of T</returns> public static T ParseEnum <T>(string inString, bool ignoreCase = true) where T : struct => GenericParseEnum.ParseEnumExt <T>(inString, ignoreCase);