SmartDeviceProxy.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. 
  2. using System;
  3. using Curtain.WCF.Proxy;
  4. using Dongke.IBOSS.PRD.WCF.Contracts;
  5. using PCLCommunication;
  6. namespace PLCCommunication.Proxy
  7. {
  8. public class SmartDeviceProxy : WCFProxy<ISmartDevice>
  9. {
  10. private SmartDeviceProxy(WCFProxySetting setting)
  11. : base("endpoint_SmartDevice", setting, "SmartDeviceService")
  12. {
  13. }
  14. public SmartDeviceProxy(string settingName = null)
  15. : base("endpoint_SmartDevice", settingName, "SmartDeviceService")
  16. {
  17. }
  18. private static SmartDeviceProxy _instance = null;
  19. /// <summary>
  20. /// 默认代理
  21. /// </summary>
  22. public static SmartDeviceProxy Instance
  23. {
  24. get
  25. {
  26. if (_instance == null)
  27. {
  28. _instance = new SmartDeviceProxy();
  29. }
  30. return _instance;
  31. }
  32. }
  33. protected override Exception InvokeException(string methodName, Exception ex)
  34. {
  35. LogOut.Error(this.ServiceName, ex, methodName);
  36. return null;
  37. //return ex;
  38. }
  39. //protected override TResult InvokeDone<TResult>(string methodName, TResult result, bool isOneWay = false)
  40. //{
  41. // return result;
  42. // return Commons.InvokeDone(methodName, result, isOneWay);
  43. //}
  44. }
  45. }