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); } }
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); }
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); } }
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); } }