Example #1
0
 /// <summary>
 /// Converts enum value into primitive type <see cref="short"/>.
 /// </summary>
 /// <typeparam name="T">Type of the enum value to be converted.</typeparam>
 /// <param name="value">Enum value to be converted.</param>
 /// <returns>Enum value represented as <see cref="short"/>.</returns>
 public static short ToInt16 <T>(this T value) where T : struct, Enum => ValueTypeExtensions.ToInt16(value);
Example #2
0
 /// <summary>
 /// Converts enum value into primitive type <see cref="long"/>.
 /// </summary>
 /// <typeparam name="T">Type of the enum value to be converted.</typeparam>
 /// <param name="value">Enum value to be converted.</param>
 /// <returns>Enum value represented as <see cref="long"/>.</returns>
 public static long ToInt64 <T>(this T value) where T : struct, Enum => ValueTypeExtensions.ToInt64(value);
Example #3
0
 /// <summary>
 /// Converts enum value into primitive type <see cref="int"/>.
 /// </summary>
 /// <typeparam name="T">Type of the enum value to be converted.</typeparam>
 /// <param name="value">Enum value to be converted.</param>
 /// <returns>Enum value represented as <see cref="int"/>.</returns>
 public static int ToInt32 <T>(this T value) where T : struct, Enum => ValueTypeExtensions.ToInt32(value);
Example #4
0
 public static sbyte ToSByte <T>(this T value) where T : struct, Enum => ValueTypeExtensions.ToSByte(value);