private void FillCitationCounts() { var topicEx = FeatureRegex.TopicNum; var messageEx = FeatureRegex.MessageNum; foreach (var message in DBCache.GetPostMessagesFromDB(buhOnlineContext)) { foreach (Match match in topicEx.Matches(message)) { var topicId = int.Parse(match.Groups[1].Value); if (!TopicCitedCounts.ContainsKey(topicId)) { TopicCitedCounts[topicId] = 0; } TopicCitedCounts[topicId]++; } foreach (Match match in messageEx.Matches(message)) { var messageId = int.Parse(match.Groups[1].Value); if (!MessageCitedCounts.ContainsKey(messageId)) { MessageCitedCounts[messageId] = 0; } MessageCitedCounts[messageId]++; } } }