public void KeyVisit( IntSeqKey controllerPath, BiConsumer<object, int> keyAndSubpathOrCPId) { foreach (var entry in _keys) { if (controllerPath.Equals(entry.Key.Path)) { keyAndSubpathOrCPId.Invoke(entry.Key.Key, entry.Value.SubpathOrCPId); } } }
public void KeyVisitEntry( IntSeqKey controllerPath, Consumer<ContextControllerKeyedSvcEntry> consumer) { foreach (var entry in _keys) { if (controllerPath.Equals(entry.Key.Path)) { consumer.Invoke(entry.Value); } } }
public IList<ContextControllerConditionNonHA> KeyGetTermConditions(IntSeqKey controllerPath) { IList<ContextControllerConditionNonHA> conditions = new List<ContextControllerConditionNonHA>(); foreach (var entry in _keys) { if (controllerPath.Equals(entry.Key.Path)) { conditions.Add(entry.Value.TerminationCondition); } } return conditions; }
public ICollection<int> Deactivate(IntSeqKey controllerPath) { var entriesToRemove = _keys .Where(entry => controllerPath.Equals(entry.Key.Path)) .ToList(); var ids = entriesToRemove .Select(entry => entry.Value.SubpathOrCPId) .ToList(); entriesToRemove.ForEach(entry => _keys.Remove(entry.Key)); return ids; }