RefreshInfo.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // RefreshInfo.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 RefreshInfo
  14. {
  15. [MessageBodyMember (Name = "Refresh", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  16. RefreshInfoDC Body {
  17. get {
  18. if (body == null)
  19. body = new RefreshInfoDC ();
  20. return body;
  21. }
  22. set { body = value; }
  23. }
  24. RefreshInfoDC body;
  25. public RefreshInfo ()
  26. {
  27. }
  28. public RefreshInfo (string meshId, Guid regId)
  29. : this ()
  30. {
  31. Body.MeshId = meshId;
  32. Body.RegistrationId = regId;
  33. }
  34. public string MeshId {
  35. get { return Body.MeshId; }
  36. }
  37. public Guid RegistrationId {
  38. get { return Body.RegistrationId; }
  39. }
  40. public bool HasBody ()
  41. {
  42. return true; // FIXME: I have no idea when it returns false
  43. }
  44. }
  45. [DataContract (Name = "Refresh", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  46. internal class RefreshInfoDC
  47. {
  48. string mesh_id;
  49. Guid registration_id;
  50. public RefreshInfoDC ()
  51. {
  52. }
  53. [DataMember]
  54. public string MeshId {
  55. get { return mesh_id; }
  56. set { mesh_id = value; }
  57. }
  58. [DataMember]
  59. public Guid RegistrationId {
  60. get { return registration_id; }
  61. set { registration_id = value; }
  62. }
  63. }
  64. }