2
0

UpdateInfo.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //
  2. // UpdateInfo.cs
  3. //
  4. // Author:
  5. // Marcos Cobena ([email protected])
  6. //
  7. // Copyright 2007 Marcos Cobena (http://www.youcannoteatbits.org/)
  8. //
  9. using System.Runtime.Serialization;
  10. namespace System.ServiceModel.PeerResolvers
  11. {
  12. [MessageContract (IsWrapped = false)]
  13. public class UpdateInfo
  14. {
  15. [MessageBodyMember (Name = "Update", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  16. UpdateInfoDC Body {
  17. get {
  18. if (body == null)
  19. body = new UpdateInfoDC ();
  20. return body;
  21. }
  22. set { body = value; }
  23. }
  24. UpdateInfoDC body;
  25. public UpdateInfo ()
  26. {
  27. }
  28. public UpdateInfo (Guid registrationId, Guid client, string meshId, PeerNodeAddress address)
  29. : this ()
  30. {
  31. Body.RegistrationId = registrationId;
  32. Body.ClientId = client;
  33. Body.MeshId = meshId;
  34. Body.NodeAddress = address;
  35. }
  36. public Guid ClientId {
  37. get { return Body.ClientId; }
  38. }
  39. public string MeshId {
  40. get { return Body.MeshId; }
  41. }
  42. public PeerNodeAddress NodeAddress {
  43. get { return Body.NodeAddress; }
  44. }
  45. public Guid RegistrationId {
  46. get { return Body.RegistrationId; }
  47. }
  48. public bool HasBody ()
  49. {
  50. return true; // FIXME: I have no idea when it returns false
  51. }
  52. }
  53. [DataContract (Name = "Update", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  54. internal class UpdateInfoDC
  55. {
  56. Guid client_id;
  57. string mesh_id;
  58. PeerNodeAddress node_address;
  59. Guid registration_id;
  60. public UpdateInfoDC ()
  61. {
  62. }
  63. [DataMember]
  64. public Guid ClientId {
  65. get { return client_id; }
  66. set { client_id = value; }
  67. }
  68. [DataMember]
  69. public string MeshId {
  70. get { return mesh_id; }
  71. set { mesh_id = value; }
  72. }
  73. [DataMember]
  74. public PeerNodeAddress NodeAddress {
  75. get { return node_address; }
  76. set { node_address = value; }
  77. }
  78. [DataMember]
  79. public Guid RegistrationId {
  80. get { return registration_id; }
  81. set { registration_id = value; }
  82. }
  83. }
  84. }