private void AddToList(RollCallItem rci, ICollection<RollCallItem> rciList) { if (!_firegroundEnabled) return; if (rci == null || rciList == null) return; if (rciList.FirstOrDefault(r => r.SignalingLookupKey == rci.SignalingLookupKey) == null) { rciList.Add(rci); } }
private void RemoveFromList(RollCallItem rci, ICollection<RollCallItem> rciList) { if (!_firegroundEnabled) return; if (rci == null || rciList == null) return; RollCallItem[] rciArray = rciList.Where(r => r.SignalingLookupKey == rci.SignalingLookupKey).ToArray(); if (rciArray != null && rciArray.Length > 0) { foreach (RollCallItem r in rciArray) { rciList.Remove(r); } } }
public void AddToGoodList(RollCallItem rci) { AddToParticipantsList(rci); RemoveFromList(rci, _rollCallWaiting); AddToList(rci, _rollCallGood); }
public void AddToParticipantsList(RollCallItem rci) { AddToList(rci, _rollCallParticipants); }
public void HandleRadioSignal(RadioSignalingItem sigItem, EmergencyState emerState= EmergencyState.NonEmergency) { if (!_firegroundEnabled) return; if (sigItem == null) return; RadioInfo rInfo = RadioInfoLookupHelper.Instance.GetRadioInfoFromSignalingItem(sigItem); if (rInfo == null || rInfo.ExcludeFromRollCall) return; RollCallItem rci = GetItemFromLookupKey(rInfo.SignalingLookupKey); if (rci == null) { rci = new RollCallItem(rInfo, emerState); } else { rci.EmergencyState = emerState; } if (_rollCallActive) { AddToGoodList(rci); } else { AddToWaitingList(rci); } }
public void RemoveFromRollCall(RollCallItem rci) { RemoveFromList(rci, _rollCallParticipants); RemoveFromList(rci, _rollCallGood); RemoveFromList(rci, _rollCallWaiting); }