1.1 --- a/Server/Servers.cs Wed Aug 13 23:02:40 2014 +0200
1.2 +++ b/Server/Servers.cs Thu Aug 14 00:23:18 2014 +0200
1.3 @@ -2,6 +2,8 @@
1.4 using System.Windows.Forms;
1.5 using System.Collections;
1.6 using System.ServiceModel;
1.7 +using System.Collections.Generic;
1.8 +using System.Linq;
1.9
1.10 namespace SharpDisplayManager
1.11 {
1.12 @@ -47,9 +49,19 @@
1.13 public void Connect(string aClientName)
1.14 {
1.15 IDisplayServiceCallback callback = OperationContext.Current.GetCallbackChannel<IDisplayServiceCallback>();
1.16 - callback.OnConnected();
1.17 + //remove the old client if any
1.18 + if (Program.iMainForm.iClients.Keys.Contains(aClientName))
1.19 + {
1.20 + Program.iMainForm.iClients.Remove(aClientName);
1.21 + }
1.22 + //Register our client
1.23 + Program.iMainForm.iClients.Add(aClientName, callback);
1.24 +
1.25 + //For some reason MP still hangs on that one
1.26 + //callback.OnConnected();
1.27 }
1.28
1.29 +
1.30 }
1.31
1.32 }