RefreshResponseInfo.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // RefreshResponseInfo.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 RefreshResponseInfo
  14. {
  15. // FIXME: I'm not 100% sure its Name is "Update", I need to take some more long period traces.
  16. [MessageBodyMember (Name = "Update", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  17. RefreshResponseInfoDC body;
  18. public RefreshResponseInfo ()
  19. {
  20. body = new RefreshResponseInfoDC ();
  21. }
  22. public RefreshResponseInfo (TimeSpan registrationLifetime, RefreshResult result)
  23. : this ()
  24. {
  25. body.RegistrationLifetime = registrationLifetime;
  26. body.Result = result;
  27. }
  28. public TimeSpan RegistrationLifetime {
  29. get { return body.RegistrationLifetime; }
  30. set { body.RegistrationLifetime = value; }
  31. }
  32. public RefreshResult Result {
  33. get { return body.Result; }
  34. set { body.Result = value; }
  35. }
  36. [MonoTODO]
  37. public bool HasBody ()
  38. {
  39. throw new NotImplementedException ();
  40. }
  41. }
  42. [DataContract]
  43. internal class RefreshResponseInfoDC
  44. {
  45. TimeSpan registration_lifetime;
  46. RefreshResult result;
  47. public RefreshResponseInfoDC ()
  48. {
  49. }
  50. [DataMember]
  51. public TimeSpan RegistrationLifetime {
  52. get { return registration_lifetime; }
  53. set { registration_lifetime = value; }
  54. }
  55. [DataMember]
  56. public RefreshResult Result {
  57. get { return result; }
  58. set { result = value; }
  59. }
  60. }
  61. }