EnumControlJobState.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MECF.Framework.Common.Jobs
  7. {
  8. //SEMI E94
  9. public enum EnumControlJobState
  10. {
  11. Queued,
  12. Selected,
  13. WaitingForStart,
  14. Executing,
  15. Paused,
  16. Completed,
  17. }
  18. public static class EnumControlJobState_Extension
  19. {
  20. public static bool IsQueued(this EnumControlJobState state) => state == EnumControlJobState.Queued;
  21. public static bool IsSelected(this EnumControlJobState state) => state == EnumControlJobState.Selected;
  22. public static bool IsWaitingForStart(this EnumControlJobState state) => state == EnumControlJobState.WaitingForStart;
  23. public static bool IsExecuting(this EnumControlJobState state) => state == EnumControlJobState.Executing;
  24. public static bool IsPaused(this EnumControlJobState state) => state == EnumControlJobState.Paused;
  25. public static bool IsCompleted(this EnumControlJobState state) => state == EnumControlJobState.Completed;
  26. public static bool IsBeforeExecute(this EnumControlJobState state) => state == EnumControlJobState.Queued
  27. || state == EnumControlJobState.Selected
  28. || state == EnumControlJobState.WaitingForStart;
  29. }
  30. }