EventServiceCallback.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Aitex.Core.RT.Event;
  6. using Aitex.Core.Util;
  7. using System.ServiceModel;
  8. using Aitex.Core.WCF.Interface;
  9. using System.IO;
  10. namespace Aitex.Core.WCF
  11. {
  12. [CallbackBehavior(ConcurrencyMode=ConcurrencyMode.Multiple, UseSynchronizationContext=false)]
  13. public class EventServiceCallback : IEventServiceCallback
  14. {
  15. public event Action<EventItem> FireEvent;
  16. public event Action<bool> OnLockAndUnlockEvent;
  17. public event Func<IEnumerable<string>,bool?> OnUpdateWaferEvent;//通知获取wafer更新数据
  18. public void SendEvent(EventItem ev)
  19. {
  20. if (FireEvent != null)
  21. {
  22. FireEvent(ev);
  23. }
  24. }
  25. public void SendLockEvent(bool isLock)
  26. {
  27. if (OnLockAndUnlockEvent != null)
  28. {
  29. OnLockAndUnlockEvent(isLock);
  30. }
  31. }
  32. public bool? SendChangedWaferModule(IEnumerable<string> changedModule)=> OnUpdateWaferEvent?.Invoke(changedModule);
  33. }
  34. }