説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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