RefreshResponseInfo.cs 1.6 KB

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