UpdateInfo.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel.PeerResolvers
  5. {
  6. using System.ServiceModel.Channels;
  7. using System.ServiceModel;
  8. using System.Runtime.Serialization;
  9. [MessageContract(IsWrapped = false)]
  10. public class UpdateInfo
  11. {
  12. [DataContract(Name = "Update", Namespace = PeerStrings.Namespace)]
  13. class UpdateInfoDC
  14. {
  15. [DataMember(Name = "ClientId")]
  16. public Guid ClientId;
  17. [DataMember(Name = "MeshId")]
  18. public string MeshId;
  19. [DataMember(Name = "NodeAddress")]
  20. public PeerNodeAddress NodeAddress;
  21. [DataMember(Name = "RegistrationId")]
  22. public Guid RegistrationId;
  23. public UpdateInfoDC() { }
  24. public UpdateInfoDC(Guid registrationId, Guid client, string meshId, PeerNodeAddress address)
  25. {
  26. this.ClientId = client;
  27. this.MeshId = meshId;
  28. this.NodeAddress = address;
  29. this.RegistrationId = registrationId;
  30. }
  31. }
  32. public UpdateInfo(Guid registrationId, Guid client, string meshId, PeerNodeAddress address)
  33. {
  34. body = new UpdateInfoDC(registrationId, client, meshId, address);
  35. }
  36. public UpdateInfo() { body = new UpdateInfoDC(); }
  37. public Guid ClientId
  38. {
  39. get { return this.body.ClientId; }
  40. }
  41. public Guid RegistrationId
  42. {
  43. get { return this.body.RegistrationId; }
  44. }
  45. public string MeshId
  46. {
  47. get { return this.body.MeshId; }
  48. }
  49. public PeerNodeAddress NodeAddress
  50. {
  51. get { return this.body.NodeAddress; }
  52. }
  53. [MessageBodyMember(Name = "Update", Namespace = PeerStrings.Namespace)]
  54. UpdateInfoDC body;
  55. public bool HasBody()
  56. {
  57. return body != null;
  58. }
  59. }
  60. }