ICommunication.cs 869 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ICommunication
  7. {
  8. public interface ICommunication:EventBus.IEventBroker
  9. {
  10. public string IP { get; }
  11. public int Port { get; }
  12. public bool IsLan { get; }
  13. public bool IsConnected { get; }
  14. public event EventHandler Connected;
  15. public event EventHandler Disconnected;
  16. public bool IsService { get; }
  17. public void Connect(string ip, int port);
  18. public void StartService(string ip,int port);
  19. public void Close();
  20. public void Start();
  21. }
  22. public sealed class CommunicationTypeAttribute:Attribute
  23. {
  24. public CommunicationTypeAttribute(bool isLan)
  25. {
  26. IsLan = isLan;
  27. }
  28. public bool IsLan { get; }
  29. }
  30. }