public List <ClientState> GetStates(params LiveState[] states) { if (null != ClientStates && ClientStates.Any() && states.Length > 0) { return(ClientStates.Where(x => states.Contains(x.Status)).ToList()); } return(new List <ClientState>()); }
public bool IsInState(params LiveState[] states) { if (null != ClientStates && ClientStates.Any() && states.Length > 0) { var found = ClientStates.Where(x => states.Contains(x.Status)).ToList(); return(found.Count == states.Length); } return(false); }
public bool IsInAnyState(Guid indexId, params LiveState[] states) { if (null != ClientStates && ClientStates.Any(x => null != x.IndexClientId && x.IndexClientId == indexId) && states.Length > 0) { var found = ClientStates.Where(x => states.Contains(x.Status) && x.IndexClientId == indexId).ToList(); return(found.Count > 0); } return(false); }