mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 04:55:42 +00:00
Add Enum constraint to string.EnumParse<T>
This commit is contained in:
parent
af3dfaa623
commit
3bbf689db4
@ -105,6 +105,7 @@ namespace X10D
|
||||
/// (http://geekswithblogs.net/sdorman/Default.aspx).
|
||||
/// </remarks>
|
||||
public static T EnumParse<T>(this string value)
|
||||
where T : struct, Enum
|
||||
{
|
||||
return value.EnumParse<T>(false);
|
||||
}
|
||||
@ -121,6 +122,7 @@ namespace X10D
|
||||
/// (http://geekswithblogs.net/sdorman/Default.aspx).
|
||||
/// </remarks>
|
||||
public static T EnumParse<T>(this string value, bool ignoreCase)
|
||||
where T : struct, Enum
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user