示例#1
0
 /// <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);
示例#2
0
 /// <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);
示例#3
0
 /// <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);
示例#4
0
 /// <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);