ResolveInfo.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 ResolveInfo
  11. {
  12. [DataContract(Name = "ResolveInfo", Namespace = PeerStrings.Namespace)]
  13. class ResolveInfoDC
  14. {
  15. [DataMember(Name = "ClientId")]
  16. public Guid ClientId;
  17. [DataMember(Name = "MeshId")]
  18. public string MeshId;
  19. [DataMember(Name = "MaxAddresses")]
  20. public int MaxAddresses;
  21. public ResolveInfoDC(Guid clientId, string meshId, int maxAddresses)
  22. {
  23. this.ClientId = clientId;
  24. this.MeshId = meshId;
  25. this.MaxAddresses = maxAddresses;
  26. }
  27. public ResolveInfoDC() { }
  28. }
  29. [MessageBodyMember(Name = "Resolve", Namespace = PeerStrings.Namespace)]
  30. ResolveInfoDC body;
  31. public ResolveInfo(Guid clientId, string meshId, int maxAddresses)
  32. {
  33. body = new ResolveInfoDC(clientId, meshId, maxAddresses);
  34. }
  35. public ResolveInfo()
  36. {
  37. body = new ResolveInfoDC();
  38. }
  39. public Guid ClientId
  40. {
  41. get { return this.body.ClientId; }
  42. }
  43. public string MeshId
  44. {
  45. get { return this.body.MeshId; }
  46. }
  47. public int MaxAddresses
  48. {
  49. get { return this.body.MaxAddresses; }
  50. }
  51. public bool HasBody()
  52. {
  53. return body != null;
  54. }
  55. }
  56. }