No Description
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.

EnumExtensions.cs 571B

1234567891011121314151617181920
  1. using System;
  2. namespace Unity.PlasticSCM.Editor
  3. {
  4. internal static class EnumExtensions
  5. {
  6. internal static bool HasFlag(this Enum variable, Enum value)
  7. {
  8. if (variable.GetType() != value.GetType())
  9. throw new ArgumentException(
  10. "The checked flag is not from the same type as the checked variable.");
  11. Convert.ToUInt64(value);
  12. ulong num = Convert.ToUInt64(value);
  13. ulong num2 = Convert.ToUInt64(variable);
  14. return (num2 & num) == num;
  15. }
  16. }
  17. }