UpdateInfo.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. }
  23. UpdateInfoDC body;
  24. public UpdateInfo ()
  25. {
  26. }
  27. public UpdateInfo (Guid registrationId, Guid client, string meshId, PeerNodeAddress address)
  28. : this ()
  29. {
  30. Body.RegistrationId = registrationId;
  31. Body.ClientId = client;
  32. Body.MeshId = meshId;
  33. Body.NodeAddress = address;
  34. }
  35. public Guid ClientId {
  36. get { return Body.ClientId; }
  37. }
  38. public string MeshId {
  39. get { return Body.MeshId; }
  40. }
  41. public PeerNodeAddress NodeAddress {
  42. get { return Body.NodeAddress; }
  43. }
  44. public Guid RegistrationId {
  45. get { return Body.RegistrationId; }
  46. }
  47. public bool HasBody ()
  48. {
  49. return true; // FIXME: I have no idea when it returns false
  50. }
  51. }
  52. [DataContract (Name = "Update", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  53. internal class UpdateInfoDC
  54. {
  55. Guid client_id;
  56. string mesh_id;
  57. PeerNodeAddress node_address;
  58. Guid registration_id;
  59. public UpdateInfoDC ()
  60. {
  61. }
  62. [DataMember]
  63. public Guid ClientId {
  64. get { return client_id; }
  65. set { client_id = value; }
  66. }
  67. [DataMember]
  68. public string MeshId {
  69. get { return mesh_id; }
  70. set { mesh_id = value; }
  71. }
  72. [DataMember]
  73. public PeerNodeAddress NodeAddress {
  74. get { return node_address; }
  75. set { node_address = value; }
  76. }
  77. [DataMember]
  78. public Guid RegistrationId {
  79. get { return registration_id; }
  80. set { registration_id = value; }
  81. }
  82. }
  83. }