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.
20 lines
571 B
20 lines
571 B
using System; |
|
|
|
namespace Unity.PlasticSCM.Editor |
|
{ |
|
internal static class EnumExtensions |
|
{ |
|
internal static bool HasFlag(this Enum variable, Enum value) |
|
{ |
|
if (variable.GetType() != value.GetType()) |
|
throw new ArgumentException( |
|
"The checked flag is not from the same type as the checked variable."); |
|
|
|
Convert.ToUInt64(value); |
|
ulong num = Convert.ToUInt64(value); |
|
ulong num2 = Convert.ToUInt64(variable); |
|
|
|
return (num2 & num) == num; |
|
} |
|
} |
|
}
|
|
|