RefreshInfo.cs 1.4 KB

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