UpdateInfo.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. [MonoTODO]
  42. public bool HasBody ()
  43. {
  44. throw new NotImplementedException ();
  45. }
  46. }
  47. [DataContract]
  48. internal class UpdateInfoDC
  49. {
  50. Guid client_id;
  51. string mesh_id;
  52. PeerNodeAddress node_address;
  53. Guid registration_id;
  54. public UpdateInfoDC ()
  55. {
  56. }
  57. [DataMember]
  58. public Guid ClientId {
  59. get { return client_id; }
  60. set { client_id = value; }
  61. }
  62. [DataMember]
  63. public string MeshId {
  64. get { return mesh_id; }
  65. set { mesh_id = value; }
  66. }
  67. [DataMember]
  68. public PeerNodeAddress NodeAddress {
  69. get { return node_address; }
  70. set { node_address = value; }
  71. }
  72. [DataMember]
  73. public Guid RegistrationId {
  74. get { return registration_id; }
  75. set { registration_id = value; }
  76. }
  77. }
  78. }