RefreshResponseInfo.cs 1.5 KB

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