Handler.cs 558 B

123456789101112131415161718192021
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WCS.Core;
  7. using WCS.Entity;
  8. using WCS.Entity.Protocol;
  9. namespace WCS.Service.Handlers
  10. {
  11. public abstract class Handler<T> : LogicHandler<T> where T : EntityEx<WCS_DEVICE>
  12. {
  13. protected virtual bool Parallel { get { return false; } }
  14. protected abstract bool Selecte(WCS_DEVICE obj);
  15. public override void Start()
  16. {
  17. AddWork(v => Selecte(v.Entity), Execute, Parallel);
  18. }
  19. }
  20. }