Multiprocotol Terminalprogram (BAT)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MultiTerm/Common/Helpers/EnumHelpers.cs

15 lines
435 B

namespace Common.Helpers;
public static class EnumHelpers
{
/// <summary>
/// Parse enum from string to enum type.
/// </summary>
/// <typeparam name="T">type of the enum</typeparam>
/// <param name="value">value to parse to enum</param>
/// <returns>returns enum object with value</returns>
public static T ParseEnum<T>(string value)
{
return (T)Enum.Parse(typeof(T), value, true);
}
}