private void _events_RemoveFromHeuristics(object sender, RemoveHeuristicsEventArgs e) { if (e.SingleForRemoval != null) { _cachedInfos.Remove(e.SingleForRemoval); } else { foreach (HeuristicsInfo expired in e.CollectionForRemoval) { _cachedInfos.Remove(expired); } } }
public void Collect(object?state) { HeuristicsInfo[] expired = _heuristics.GetExpiredCache(); if (expired.Length == 0) { return; } RemoveHeuristicsEventArgs removeArgs = new RemoveHeuristicsEventArgs { CollectionForRemoval = expired }; _events.OnRemoveFromHeuristics(removeArgs); }
public void OnRemoveFromHeuristics(RemoveHeuristicsEventArgs args) { RemoveFromHeuristics?.Invoke(this, args); }
private void _events_RemoveFromHeuristics(object sender, RemoveHeuristicsEventArgs e) { HeuristicsInfo expired = _cachedInfos.FirstOrDefault(x => x.Channel == e.Channel && x.ChannelMethod == e.ChannelMethod); _cachedInfos.Remove(expired); }