ClientConfig.cs 447 B

123456789101112131415161718192021222324252627282930
  1. using System.Net;
  2. using MongoDB.Bson.Serialization.Attributes;
  3. namespace Model
  4. {
  5. [BsonIgnoreExtraElements]
  6. public class ClientConfig: AConfigComponent
  7. {
  8. public string Host = "";
  9. public int Port;
  10. [BsonIgnore]
  11. public string Address
  12. {
  13. get
  14. {
  15. return $"{this.Host}:{this.Port}";
  16. }
  17. }
  18. [BsonIgnore]
  19. public IPEndPoint IPEndPoint
  20. {
  21. get
  22. {
  23. return NetworkHelper.ToIPEndPoint(this.Host, this.Port);
  24. }
  25. }
  26. }
  27. }