Exemplo n.º 1
0
            public void RemoveUser(Client client)
            {
                var c = ActiveClients.FirstOrDefault(x => x.GridID == client.GridID | x.ID == client.ID);

                if (c != default(Client))
                {
                    ActiveClients.Remove(c);
                }
            }
Exemplo n.º 2
0
            public bool UpdateUser(Client client)
            {
                var c = ActiveClients.FirstOrDefault(x => x.GridID == client.GridID | x.ID == client.ID);

                if (c != default(Client))
                {
                    ActiveClients[ActiveClients.IndexOf(c)] = client;
                }
                else
                {
                    ActiveClients.Add(client);
                }
                return(true);
            }
Exemplo n.º 3
0
            public bool TryGetClientFromName(string id, out Client client)
            {
                var c = (ActiveClients.FirstOrDefault(x => x.Name == id));

                if (c != null)
                {
                    client = c;
                    return(true);
                }
                else
                {
                    client = null;
                    return(false);
                }
            }
Exemplo n.º 4
0
            public bool TryGetClientFromID(long id, out Client client)
            {
                var c = (ActiveClients.FirstOrDefault(x => x.GridID == id | x.ID == id));

                if (c != null)
                {
                    client = c;
                    return(true);
                }
                else
                {
                    client = null;
                    return(false);
                }
            }