Server/Servers.cs
changeset 32 4c416d2878dd
parent 30 c375286d1a1c
child 34 59bfa4ebcbbb
     1.1 --- a/Server/Servers.cs	Fri Aug 15 11:11:17 2014 +0200
     1.2 +++ b/Server/Servers.cs	Fri Aug 15 13:26:38 2014 +0200
     1.3 @@ -20,6 +20,7 @@
     1.4      class DisplayServer : IDisplayService, IDisposable
     1.5      {
     1.6          public string SessionId { get; set; }
     1.7 +        public string Name { get; set; }
     1.8  
     1.9          DisplayServer()
    1.10          {
    1.11 @@ -51,8 +52,10 @@
    1.12          }
    1.13  
    1.14          //
    1.15 -        public void Connect(string aClientName)
    1.16 +        public void SetName(string aClientName)
    1.17          {
    1.18 +            Name = aClientName;
    1.19 +            Program.iMainForm.SetClientNameThreadSafe(SessionId, Name);
    1.20              //Disconnect(aClientName);
    1.21  
    1.22              //Register our client and its callback interface
    1.23 @@ -64,17 +67,9 @@
    1.24          }
    1.25  
    1.26          ///
    1.27 -        public void Disconnect(string aClientName)
    1.28 +        public int ClientCount()
    1.29          {
    1.30 -            //remove the old client if any
    1.31 -            /*
    1.32 -            if (Program.iMainForm.iClients.Keys.Contains(aClientName))
    1.33 -            {
    1.34 -                Program.iMainForm.iClients.Remove(aClientName);
    1.35 -                Program.iMainForm.treeViewClients.Nodes.Remove(Program.iMainForm.treeViewClients.Nodes.Find(aClientName,false)[0]);
    1.36 -            }
    1.37 -             */
    1.38 -
    1.39 +            return Program.iMainForm.iClients.Count;
    1.40          }
    1.41  
    1.42