private TopicReport GetTopicReport(TrackTopicsEvent topicCollection, TrackTopic topicEvent) { var key = topicEvent.Topic + "#" + topicCollection.Detail + "#" + topicCollection.Url; if (!topicDictionary.TryGetValue(key, out var topicReport)) { topicReport = new TopicReport(topicEvent.Topic, topicCollection.Detail, topicCollection.Url); topicReport.LastVisibleGeneration = Int32.MinValue; topicDictionary[key] = topicReport; } return(topicReport); }
private String FormatVisibility(TrackTopic topic) { var start = Math.Round(topic.Start * 100, 0); var end = Math.Round(topic.End * 100, 0); if (start == 0 && end == 100) { return(String.Empty); } else if (start == 0) { return($" (..{end})"); } else if (end == 100) { return($" ({start}..)"); } else { return($" ({start}-{end})"); } }