UpdateInfo.cs 1.8 KB

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