CapDemo.Open_Game.TableAnswerMultiTeam_1 C# (CSharp) Метод

TableAnswerMultiTeam_1() приватный Метод

private TableAnswerMultiTeam_1 ( List ListQuestion, List ListAnswer ) : void
ListQuestion List
ListAnswer List
Результат void
        void TableAnswerMultiTeam_1(List<Question> ListQuestion, List<Answer> ListAnswer)
        {
            int a = 65;
            int No = 0;
            int D = 0;
            foreach (Team teamCS in flp_Team.Controls)
            {
                teamCS.chk_Challenged.Visible = false;
                if (teamCS.chk_Challenged.Checked == true)
                {
                    D++;
                }
            }
            int D1 = D - 1;
            /////show answer one on control screen
            foreach (Team teamCS in flp_Team.Controls)
            {
                teamCS.chk_Challenged.Visible = false;
                if (teamCS.chk_Challenged.Checked == true)
                {
                    PlayerAnswer PlayerAnswer = new PlayerAnswer();
                    PlayerAnswer.pb_Result.BackColor = Color.FromArgb(colorplayer(Convert.ToInt32(teamCS.lbl_IDPlayer.Text)));
                    PlayerAnswer.lbl_IDPlayer.Text = teamCS.lbl_IDPlayer.Text;
                    PlayerAnswer.lbl_TeamName.Text = teamCS.lbl_TeamName.Text;
                    PlayerAnswer.Location = new Point(PlayerAnswer.Location.X + (audience.flp_PlayerAnswers.Width / (D) / 2 - PlayerAnswer.Width / 2) + audience.flp_PlayerAnswers.Width / D * No, PlayerAnswer.Location.Y + 5);
                    audience.flp_PlayerAnswers.Controls.Add(PlayerAnswer);
                    No++;
                    D1--;
                    if (ListQuestion.ElementAt(0).TypeQuestion.ToLower() == "onechoice")
                    {
                        for (int h = 0; h < ListAnswer.Count; h++)
                        {
                            RadioButton radioButton = new RadioButton();
                            radioButton.ForeColor = Color.White;
                            radioButton.Text = Convert.ToChar(a + h).ToString();
                            radioButton.AutoSize = true;
                            teamCS.flp_Answer.Controls.Add(radioButton);
                        }
                    }
                    else
                    {
                        if (ListQuestion.ElementAt(0).TypeQuestion.ToLower() == "multichoice")
                        {
                            for (int h = 0; h < ListAnswer.Count; h++)
                            {
                                CheckBox checkBox = new CheckBox();
                                checkBox.ForeColor = Color.White;
                                checkBox.Text = Convert.ToChar(a + h).ToString();
                                checkBox.AutoSize = true;
                                teamCS.flp_Answer.Controls.Add(checkBox);
                            }
                        }
                        else
                        {
                            TextBox textBox = new TextBox();
                            textBox.ForeColor = Color.Black;
                            textBox.AutoSize = false;
                            textBox.Anchor = AnchorStyles.Top;
                            textBox.Anchor = AnchorStyles.Left;
                            textBox.Location = new Point(textBox.Location.X + 0, textBox.Location.Y + 0);
                            textBox.Size = new System.Drawing.Size(teamCS.flp_Answer.Width - 7, teamCS.flp_Answer.Height - 7);
                            textBox.Font = new Font("Verdana", 12.0f, FontStyle.Bold);
                            teamCS.flp_Answer.Controls.Add(textBox);
                        }
                    }
                }
            }
        }