AlarmServiceClient.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Aitex.Core.RT.Event;
  2. using Aitex.Core.Util;
  3. using Aitex.Core.WCF;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace MECF.Framework.Common.Alarms
  10. {
  11. public class AlarmClient : Singleton<AlarmClient>
  12. {
  13. private IAlarmDefineService _service;
  14. public IAlarmDefineService Service
  15. {
  16. get
  17. {
  18. if (_service == null)
  19. {
  20. _service = new AlarmServiceClient();
  21. }
  22. return _service;
  23. }
  24. }
  25. }
  26. public class AlarmServiceClient : ServiceClientWrapper<IAlarmDefineService>, IAlarmDefineService
  27. {
  28. public AlarmServiceClient()
  29. : base("Client_IAlarmDefineService", "AlarmDefineService")
  30. {
  31. }
  32. public Dictionary<string, Dictionary<string, EventItem>> GetAlarmDefineTemplate()
  33. {
  34. Dictionary<string, Dictionary<string, EventItem>> result = null;
  35. Invoke(svc => { result = svc.GetAlarmDefineTemplate(); });
  36. return result;
  37. }
  38. public string GetStringAlarmDefineTemplate()
  39. {
  40. string result = null;
  41. Invoke(svc => { result = svc.GetStringAlarmDefineTemplate(); });
  42. return result;
  43. }
  44. }
  45. }