Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }