IConnectConfig.cs 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MECF.Framework.Common.Communications
  7. {
  8. public interface IConnectionContext
  9. {
  10. bool IsEnabled { get; }
  11. int RetryConnectIntervalMs { get; }
  12. int MaxRetryConnectCount { get; }
  13. bool EnableCheckConnection { get; }
  14. string Address { get; }
  15. bool IsAscii { get; }
  16. string NewLine { get; }
  17. bool EnableLog { get; }
  18. }
  19. public class StaticConnectionContext:IConnectionContext
  20. {
  21. public bool IsEnabled { get; set; }
  22. public int RetryConnectIntervalMs { get; set; }
  23. public int MaxRetryConnectCount { get; set; }
  24. public bool EnableCheckConnection { get; set; }
  25. public string Address { get; set; }
  26. public bool IsAscii { get; set; }
  27. public string NewLine { get; set; }
  28. public bool EnableLog { get; set; }
  29. }
  30. }