EventServiceCallback.cs 907 B

12345678910111213141516171819202122232425262728293031323334353637
  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 void SendEvent(EventItem ev)
  18. {
  19. if (FireEvent != null)
  20. {
  21. FireEvent(ev);
  22. }
  23. }
  24. public void SendLockEvent(bool isLock)
  25. {
  26. if (OnLockAndUnlockEvent != null)
  27. {
  28. OnLockAndUnlockEvent(isLock);
  29. }
  30. }
  31. }
  32. }