RefreshResponseInfo.cs 1.6 KB

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