RefreshResponseInfo.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 = "RegreshResponse", 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. [MonoTODO]
  36. public bool HasBody ()
  37. {
  38. throw new NotImplementedException ();
  39. }
  40. }
  41. [DataContract (Name = "RefreshResponse", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  42. internal class RefreshResponseInfoDC
  43. {
  44. TimeSpan registration_lifetime;
  45. RefreshResult result;
  46. public RefreshResponseInfoDC ()
  47. {
  48. }
  49. [DataMember]
  50. public TimeSpan RegistrationLifetime {
  51. get { return registration_lifetime; }
  52. set { registration_lifetime = value; }
  53. }
  54. [DataMember]
  55. public RefreshResult Result {
  56. get { return result; }
  57. set { result = value; }
  58. }
  59. }
  60. }