2009-07-20 Jb Evain <jbevain@novell.com>
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.PeerResolvers / RefreshResponseInfo.cs
1 // 
2 // RefreshResponseInfo.cs
3 // 
4 // Author: 
5 //     Marcos Cobena (marcoscobena@gmail.com)
6 // 
7 // Copyright 2007 Marcos Cobena (http://www.youcannoteatbits.org/)
8 // 
9
10 using System.Runtime.Serialization;
11
12 namespace System.ServiceModel.PeerResolvers
13 {
14         [MessageContract (IsWrapped = false)]
15         public class RefreshResponseInfo
16         {
17                 [MessageBodyMember (Name = "RefreshResponse", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
18                 RefreshResponseInfoDC body;
19                 
20                 public RefreshResponseInfo ()
21                 {
22                         body = new RefreshResponseInfoDC ();
23                 }
24                 
25                 public RefreshResponseInfo (TimeSpan registrationLifetime, RefreshResult result)
26                         : this ()
27                 {
28                         body.RegistrationLifetime = registrationLifetime;
29                         body.Result = result;
30                 }
31                 
32                 public TimeSpan RegistrationLifetime {
33                         get { return body.RegistrationLifetime; }
34                         set { body.RegistrationLifetime = value; }
35                 }
36                 
37                 public RefreshResult Result {
38                         get { return body.Result; }
39                         set { body.Result = value; }
40                 }
41                 
42                 public bool HasBody ()
43                 {
44                         return true; // FIXME: I have no idea when it returns false
45                 }
46         }
47         
48         [DataContract (Name = "RefreshResponse", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
49         internal class RefreshResponseInfoDC
50         {
51                 TimeSpan registration_lifetime;
52                 RefreshResult result;
53
54                 public RefreshResponseInfoDC ()
55                 {
56                 }
57                 
58                 [DataMember]
59                 public TimeSpan RegistrationLifetime {
60                         get { return registration_lifetime; }
61                         set { registration_lifetime = value; }
62                 }
63                 
64                 [DataMember]
65                 public RefreshResult Result {
66                         get { return result; }
67                         set { result = value; }
68                 }
69         }
70 }