/// <summary> /// Sets up the results page for the StatComparator mode /// </summary> public void SetupStatComparatorPage(string username, string relation, string variant, int percentage, int numUsersPlayVariant, int followerCount, int averageRating, int userRating, Link ratingLink, int lowestRating, string lowestName) { RatingComparatorPanel.Invoke((MethodInvoker)(() => { RatingComparatorTimer.Stop(); RatingComparatorProgressLabel.Visible = false; })); ComparatorResultsPanel.Invoke((MethodInvoker)(() => { ComparatorResultsPanel.Visible = true; Title.Text = char.ToUpper(username[0]) + username.Substring(1) + "'s"; FollowerLabel.Text = followerCount + " " + relation; ComparatorStatementLabel1.Text = username + " has a better " + variant + " rating"; if (relation == "Following") { ComparatorStatementLabel2.Text = "than " + percentage + "% of those they follow."; } else { ComparatorStatementLabel2.Text = "than " + percentage + "% of their followers."; } PlayerCountLabel.Text = "# of " + relation + " that have " + variant + " ratings: " + numUsersPlayVariant; UsernameRatingLabel.Text = username + "'s " + variant + " rating: " + userRating; AvgRatingLabel.Text = "Average " + variant + " rating: " + averageRating; string spaceString = " "; string ratingOutputString = GetOutputString(ratingLink, false, spaceString); HighestRatingLabel.Text = "Highest " + variant + " rating: " + ratingOutputString; LowestRatingLabel.Text = "Lowest " + variant + " rating: " + lowestRating + " (" + lowestName + ")"; })); ChangePage(2); }
/// <summary> /// Method that is used to switch between the application's different pages. /// </summary> private void ChangePage(int pageNum) { switch (pageNum) { case 0: { HomePanel.Invoke((MethodInvoker)(() => { HomePanel.Visible = true; CompareRatingsButton.Enabled = true; HomePanel.BringToFront(); ComparatorCancelButton.Enabled = false; })); ComparatorResultsPanel.Invoke((MethodInvoker)(() => { ComparatorResultsPanel.Visible = false; })); FollowerStatsResultsPanel.Invoke((MethodInvoker)(() => { FollowerStatsResultsPanel.Visible = false; })); FollowerStatsPanel.Invoke((MethodInvoker)(() => { FollowerStatsPanel.Visible = false; })); RatingComparatorPanel.Invoke((MethodInvoker)(() => { RatingComparatorPanel.Visible = false; })); break; } case 1: { HomePanel.Invoke((MethodInvoker)(() => { HomePanel.Visible = false; })); RatingComparatorPanel.Invoke((MethodInvoker)(() => { RatingComparatorPanel.Enabled = true; RatingComparatorPanel.Visible = true; RatingComparatorPanel.BringToFront(); })); ComparatorResultsPanel.Invoke((MethodInvoker)(() => { ComparatorResultsPanel.Visible = false; })); break; } case 2: { RatingComparatorPanel.Invoke((MethodInvoker)(() => { RatingComparatorPanel.Visible = false; ToggleControls("RatingComparator"); })); ComparatorResultsPanel.Invoke((MethodInvoker)(() => { ComparatorResultsPanel.Visible = true; })); break; } case 3: { HomePanel.Invoke((MethodInvoker)(() => { HomePanel.Visible = false; })); FollowerStatsPanel.Invoke((MethodInvoker)(() => { FollowerStatsPanel.Visible = true; FollowerStatsPanel.BringToFront(); FollowerStatsPanel.Enabled = true; FollowerStatCancelButton.Enabled = false; })); FollowerStatsResultsPanel.Invoke((MethodInvoker)(() => { FollowerStatsResultsPanel.Visible = false; })); break; } case 4: { FollowerStatsPanel.Invoke((MethodInvoker)(() => { FollowerStatsPanel.Visible = false; ToggleControls("FollowerStat"); })); FollowerStatsResultsPanel.Invoke((MethodInvoker)(() => { FollowerStatsResultsPanel.Visible = true; })); break; } } }