InnerConfig.cs 514 B

12345678910111213141516171819202122232425262728293031
  1. using System.Net;
  2. using MongoDB.Bson.Serialization.Attributes;
  3. namespace ETModel
  4. {
  5. [BsonIgnoreExtraElements]
  6. public class InnerConfig: AConfigComponent
  7. {
  8. public string Host { get; set; }
  9. public int Port { get; set; }
  10. [BsonIgnore]
  11. private IPEndPoint ipEndPoint;
  12. public override void EndInit()
  13. {
  14. base.EndInit();
  15. this.ipEndPoint = NetworkHelper.ToIPEndPoint(this.Host, this.Port);
  16. }
  17. [BsonIgnore]
  18. public IPEndPoint IPEndPoint
  19. {
  20. get
  21. {
  22. return this.ipEndPoint;
  23. }
  24. }
  25. }
  26. }