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