private void FillStatistics(PlayerStatistics statistics) { // For each statistic category foreach (String category in statistics.GetCategories()) { // Find the tab page for this category TabPage tp = FindTabPage(category); StatisticItemListDisplay itemListDisplay = new StatisticItemListDisplay(); // Initialize properties FIRST! itemListDisplay.Top = topMargin; itemListDisplay.TopMargin = 0; itemListDisplay.StatisticsSpacing = statisticsSpacing; itemListDisplay.Width = this.ClientSize.Width - 1; itemListDisplay.Height = this.ClientSize.Height - 1; itemListDisplay.AutoSize = true; itemListDisplay.Anchor = AnchorStyles.Left | AnchorStyles.Right; // Show stats itemListDisplay.Add(statistics.GetStatistics(category)); tp.Controls.Add(itemListDisplay); } AdjustControls(); }
protected void DisplayOdds(HoldemHand playerHand, HoldemBoard board) { // Display odds List <Statistic> odds = ((HoldemOddsCalculator)oddsCalculator).Calculate(playerHand, board); StatisticItemListDisplay statisticListDisplay = CreateStatisticItemListDisplay(); statisticListDisplay.Add(odds); handControlLayout.Controls.Add(statisticListDisplay); }
protected virtual void DisplayOdds(Hand playerHand) { // Display odds List <Statistic> odds = oddsCalculator.Calculate(playerHand); StatisticItemListDisplay statisticListDisplay = CreateStatisticItemListDisplay(); statisticListDisplay.Add(odds); handControlLayout.Controls.Add(statisticListDisplay); }
protected StatisticItemListDisplay CreateStatisticItemListDisplay() { StatisticItemListDisplay statisticListDisplay = new StatisticItemListDisplay(); statisticListDisplay.BackColor = Color.Transparent; statisticListDisplay.TopMargin = 0; statisticListDisplay.Anchor = AnchorStyles.Left | AnchorStyles.Right; statisticListDisplay.Width = handControlLayout.Width - handControlLayout.Padding.Right - handControlLayout.Padding.Left; statisticListDisplay.StatisticsSpacing = 2; statisticListDisplay.AutoSize = true; return(statisticListDisplay); }
protected StatisticItemListDisplay CreateStatisticItemListDisplay() { StatisticItemListDisplay statisticListDisplay = new StatisticItemListDisplay(); statisticListDisplay.BackColor = Color.Transparent; statisticListDisplay.TopMargin = 0; statisticListDisplay.Anchor = AnchorStyles.Left | AnchorStyles.Right; statisticListDisplay.Width = handControlLayout.Width - handControlLayout.Padding.Right - handControlLayout.Padding.Left; statisticListDisplay.StatisticsSpacing = 2; statisticListDisplay.AutoSize = true; return statisticListDisplay; }
private void FillStatistics(PlayerStatistics statistics) { // For each statistic category foreach (String category in statistics.GetCategories()) { // Find the tab page for this category TabPage tp = FindTabPage(category); StatisticItemListDisplay itemListDisplay = new StatisticItemListDisplay(); // Initialize properties FIRST! itemListDisplay.Top = topMargin; itemListDisplay.TopMargin = 0; itemListDisplay.StatisticsSpacing = statisticsSpacing; itemListDisplay.Width = this.ClientSize.Width - 1; itemListDisplay.Height = this.ClientSize.Height - 1; itemListDisplay.AutoSize = true; itemListDisplay.Anchor = AnchorStyles.Left | AnchorStyles.Right; // Show stats itemListDisplay.Add(statistics.GetStatistics(category)); tp.Controls.Add(itemListDisplay); } AdjustControls(); }