ResolveInfo.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // ResolveInfo.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 ResolveInfo
  14. {
  15. [MessageBodyMember (Name = "Resolve", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
  16. ResolveInfoDC body;
  17. public ResolveInfo ()
  18. {
  19. body = new ResolveInfoDC ();
  20. }
  21. public ResolveInfo (Guid clientId, string meshId, int maxAddresses)
  22. : this ()
  23. {
  24. body.ClientId = clientId;
  25. body.MeshId = meshId;
  26. body.MaxAddresses = maxAddresses;
  27. }
  28. public Guid ClientId {
  29. get { return body.ClientId; }
  30. }
  31. public int MaxAddresses {
  32. get { return body.MaxAddresses; }
  33. }
  34. public string MeshId {
  35. get { return body.MeshId; }
  36. }
  37. [MonoTODO]
  38. public bool HasBody()
  39. {
  40. throw new NotImplementedException ();
  41. }
  42. }
  43. [DataContract]
  44. internal class ResolveInfoDC
  45. {
  46. Guid client_id;
  47. int max_addresses;
  48. string mesh_id;
  49. public ResolveInfoDC ()
  50. {
  51. }
  52. [DataMember]
  53. public Guid ClientId {
  54. get { return client_id; }
  55. set { client_id = value; }
  56. }
  57. [DataMember]
  58. public int MaxAddresses {
  59. get { return max_addresses; }
  60. set { max_addresses = value; }
  61. }
  62. [DataMember]
  63. public string MeshId {
  64. get { return mesh_id; }
  65. set { mesh_id = value; }
  66. }
  67. }
  68. }