Ejemplo n.º 1
0
 private void initScoreBoard()
 {
     if (!isInitializedScores)
     {
         teamScoreboard      = new TeamScoreBoardWrapper();
         scoreBoard          = new TeamScoreBoard(teamScoreboard);
         isInitializedScores = true;
     }
 }
Ejemplo n.º 2
0
        public TeamScoreBoard(TeamScoreBoardWrapper ts)
        {
            InitializeComponent();

            panel = new TableLayoutPanel();
            this.Controls.Clear();
            //from ts, populate labels on the form
            panel.ColumnCount = 2;
            panel.RowCount    = 1;
            panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
            panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
            panel.RowStyles.Add(new RowStyle(SizeType.Percent, 50));
            panel.Controls.Add(new Label()
            {
                Text = "Team Name"
            }, 0, 0);
            panel.Controls.Add(new Label()
            {
                Text = "Score"
            }, 1, 0);

            //tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
            foreach (var score in ts.teamScores)
            {
                panel.RowCount++;
                panel.RowStyles.Add(new RowStyle(SizeType.Percent, 50));
                panel.Controls.Add(new Label()
                {
                    Text = score.Name, AutoSize = true
                }, 0, panel.RowCount - 1);
                panel.Controls.Add(new Label()
                {
                    Text     = score.score.ToString(),
                    AutoSize = true
                }, 1, panel.RowCount - 1);


                ;
            }

            this.Controls.Add(panel);
        }
Ejemplo n.º 3
0
 private void InitScoreBoard()
 {
     teamScoreboard = new TeamScoreBoardWrapper();
 }