RegisterResponseInfo.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // RegisterResponseInfo.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 RegisterResponseInfo
  14. {
  15. [MessageBodyMember (Name = "Update", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  16. RegisterResponseInfoDC body;
  17. public RegisterResponseInfo ()
  18. {
  19. body = new RegisterResponseInfoDC ();
  20. }
  21. public RegisterResponseInfo (Guid registrationId, TimeSpan registrationLifetime)
  22. {
  23. body.RegistrationId = registrationId;
  24. body.RegistrationLifetime = registrationLifetime;
  25. }
  26. public Guid RegistrationId {
  27. get { return body.RegistrationId; }
  28. set { body.RegistrationId = value; }
  29. }
  30. public TimeSpan RegistrationLifetime {
  31. get { return body.RegistrationLifetime; }
  32. set { body.RegistrationLifetime = value; }
  33. }
  34. [MonoTODO]
  35. public bool HasBody ()
  36. {
  37. throw new NotImplementedException ();
  38. }
  39. }
  40. [DataContract]
  41. internal class RegisterResponseInfoDC
  42. {
  43. Guid registration_id;
  44. TimeSpan registration_lifetime;
  45. public RegisterResponseInfoDC ()
  46. {
  47. }
  48. [DataMember]
  49. public Guid RegistrationId {
  50. get { return registration_id; }
  51. set { registration_id = value; }
  52. }
  53. [DataMember]
  54. public TimeSpan RegistrationLifetime {
  55. get { return registration_lifetime; }
  56. set { registration_lifetime = value; }
  57. }
  58. }
  59. }