Пример #1
0
        private int getPostScore(Post i_PostToCheck)
        {
            IPostScoreCalculator postCalculator;

            BestPostFinder.eScoreCalculationStyle scoreCalculationStyle = getScoreCalcStyle();
            postCalculator = PostScoreCalculatorCreator.CreatePostScoreCalculator(scoreCalculationStyle);
            int likes        = i_PostToCheck.LikedBy.Count;
            int comments     = i_PostToCheck.Comments.Count;
            int likeValue    = 1;
            int commentValue = 1;

            if (numericUpDownLikesValue.Enabled)
            {
                likeValue    = (int)numericUpDownLikesValue.Value;
                commentValue = (int)numericUpDownCommentsValue.Value;
            }

            return(postCalculator.GetScore(likes * likeValue, comments * commentValue));
        }
Пример #2
0
        private int comparePostWrappers(Post post1, Post post2)
        {
            IPostScoreCalculator scoreCalculator = PostScoreCalculatorCreator.CreatePostScoreCalculator(getScoreCalcStyle());

            return(getPostScore(post1) - getPostScore(post2));
        }