Esempio n. 1
0
 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);
         }
     }
 }
Esempio n. 2
0
 public void KeyVisitEntry(
     IntSeqKey controllerPath,
     Consumer<ContextControllerKeyedSvcEntry> consumer)
 {
     foreach (var entry in _keys) {
         if (controllerPath.Equals(entry.Key.Path)) {
             consumer.Invoke(entry.Value);
         }
     }
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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;
        }