示例#1
0
        private IEnumerable <BeatmapCardStatistic> createStatistics()
        {
            var hypesStatistic = HypesStatistic.CreateFor(BeatmapSet);

            if (hypesStatistic != null)
            {
                yield return(hypesStatistic);
            }

            var nominationsStatistic = NominationsStatistic.CreateFor(BeatmapSet);

            if (nominationsStatistic != null)
            {
                yield return(nominationsStatistic);
            }

            yield return(new FavouritesStatistic(BeatmapSet)
            {
                Current = FavouriteState
            });

            yield return(new PlayCountStatistic(BeatmapSet));

            var dateStatistic = BeatmapCardDateStatistic.CreateFor(BeatmapSet);

            if (dateStatistic != null)
            {
                yield return(dateStatistic);
            }
        }
示例#2
0
        private void createStatistics()
        {
            BeatmapCardStatistic withMargin(BeatmapCardStatistic original)
            {
                original.Margin = new MarginPadding {
                    Right = 10
                };
                return(original);
            }

            statisticsContainer.Content[0][0] = withMargin(new FavouritesStatistic(BeatmapSet)
            {
                Current = FavouriteState,
            });

            statisticsContainer.Content[1][0] = withMargin(new PlayCountStatistic(BeatmapSet));

            var hypesStatistic = HypesStatistic.CreateFor(BeatmapSet);

            if (hypesStatistic != null)
            {
                statisticsContainer.Content[0][1] = withMargin(hypesStatistic);
            }

            var nominationsStatistic = NominationsStatistic.CreateFor(BeatmapSet);

            if (nominationsStatistic != null)
            {
                statisticsContainer.Content[1][1] = withMargin(nominationsStatistic);
            }

            var dateStatistic = BeatmapCardDateStatistic.CreateFor(BeatmapSet);

            if (dateStatistic != null)
            {
                statisticsContainer.Content[0][2] = withMargin(dateStatistic);
            }
        }