StorageOperateImp.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using SHJX.Service.ServerClient;
  2. using SHJX.Service.Model.Control;
  3. namespace SHJX.Service.Control.PortOperate.Interface
  4. {
  5. public abstract class StorageOperateImp
  6. {
  7. protected string OpName { get; set; }
  8. protected readonly OptClient Client;
  9. protected StorageOperateImp(OptClient client)
  10. {
  11. Client = client;
  12. }
  13. /// <summary>
  14. /// 启动
  15. /// </summary>
  16. public virtual bool Start(object reserve = null)
  17. {
  18. PortArgs Args = new()
  19. {
  20. WriteWay = WriteWay.Start,
  21. TypeName = OpName,
  22. Reserve= reserve
  23. };
  24. return Client.Factory(OpName).Write(Args);
  25. }
  26. /// <summary>
  27. /// 停止
  28. /// </summary>
  29. public virtual bool Stop(object reserve = null)
  30. {
  31. PortArgs Args = new()
  32. {
  33. WriteWay = WriteWay.Stop,
  34. TypeName = OpName,
  35. Reserve = reserve
  36. };
  37. return Client.Factory(OpName).Write(Args);
  38. }
  39. }
  40. }