5 // Marcos Cobena (marcoscobena@gmail.com)
7 // Copyright 2007 Marcos Cobena (http://www.youcannoteatbits.org/)
10 using System.Runtime.Serialization;
12 namespace System.ServiceModel.PeerResolvers
14 [MessageContract (IsWrapped = false)]
15 public class ResolveInfo
17 [MessageBodyMember (Name = "Resolve", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
22 body = new ResolveInfoDC ();
25 public ResolveInfo (Guid clientId, string meshId, int maxAddresses)
28 if (clientId == Guid.Empty)
29 throw new ArgumentException ("Empty Guid");
30 if (String.IsNullOrEmpty (meshId))
31 throw new ArgumentNullException ("meshId");
32 if (maxAddresses <= 0)
33 throw new ArgumentOutOfRangeException ("maxAddresses must be positive integer");
34 body.ClientId = clientId;
36 body.MaxAddresses = maxAddresses;
39 public Guid ClientId {
40 get { return body.ClientId; }
42 public int MaxAddresses {
43 get { return body.MaxAddresses; }
45 public string MeshId {
46 get { return body.MeshId; }
49 public bool HasBody ()
51 return true; // FIXME: I have no idea when it returns false
55 [DataContract (Name = "Resolve", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
56 internal class ResolveInfoDC
62 public ResolveInfoDC ()
67 public Guid ClientId {
68 get { return client_id; }
69 set { client_id = value; }
73 public int MaxAddresses {
74 get { return max_addresses; }
75 set { max_addresses = value; }
79 public string MeshId {
80 get { return mesh_id; }
81 set { mesh_id = value; }