예제 #1
0
 /// <summary>
 /// Attempts case-insensitive parsing of the specified enum. Returns null if parsing failed.
 /// Supports [EnumString("Alternate Value")] attributes and parses flags. If any segment of a comma-delimited list isn't parsed as either a number or string, null will be returned.
 /// </summary>
 /// <param name="en"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static T?Parse <T>(this T en, string value) where T : struct, IConvertible
 {
     return(EnumExtensions.Parse <T>(value));
 }