RefreshInfo.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel.PeerResolvers
  5. {
  6. using System.ServiceModel.Channels;
  7. using System.ServiceModel;
  8. using System.Runtime.Serialization;
  9. [MessageContract(IsWrapped = false)]
  10. public class RefreshInfo
  11. {
  12. [DataContract(Name = "RefreshInfo", Namespace = PeerStrings.Namespace)]
  13. class RefreshInfoDC
  14. {
  15. [DataMember(Name = "RegistrationId")]
  16. public Guid RegistrationId;
  17. [DataMember(Name = "MeshId")]
  18. public string MeshId;
  19. public RefreshInfoDC() { }
  20. public RefreshInfoDC(string meshId, Guid regId)
  21. {
  22. MeshId = meshId;
  23. RegistrationId = regId;
  24. }
  25. }
  26. public RefreshInfo(string meshId, Guid regId)
  27. {
  28. this.body = new RefreshInfoDC(meshId, regId);
  29. }
  30. public RefreshInfo()
  31. {
  32. this.body = new RefreshInfoDC();
  33. }
  34. public string MeshId { get { return body.MeshId; } }
  35. public Guid RegistrationId { get { return body.RegistrationId; } }
  36. [MessageBodyMember(Name = "Refresh", Namespace = PeerStrings.Namespace)]
  37. RefreshInfoDC body;
  38. public bool HasBody()
  39. {
  40. return body != null;
  41. }
  42. }
  43. }