private void AdvanceToImplicitRecognitionTask() { LogicEngine.InitializeImplicitRecognitionTask(); ImpRecogControls .ForEach ( control => { control.RecognitionRound = LogicEngine.ImplicitRecognitionTask.Rounds[ImpRecogControls.IndexOf(control)]; control.PictureBox.Image = control.RecognitionRound.Persona.Image; control.Radio1.Visible = false; control.Radio2.Text = "Choose"; control.Radio3.Text = "Discard"; control.Radio2.CheckedChanged += (sender, e) => { int countChecked = ImpRecogControls.Count <RecognitionUserControl>(ruc => ruc.Radio2.Checked == true); if (countChecked < 12) { ImpRecogSubmitButton.Enabled = false; } else if (countChecked == 12) { ImpRecogSubmitButton.Enabled = true; } else if (countChecked > 12) { ImpRecogSubmitButton.Enabled = false; MessageBox.Show ( string.Format("You have chosen {0} too many. ", countChecked - 12) + "Please discard those you would NOT want to play again until you reach twelve chosen players.", string.Format("Please Discard {0}", countChecked - 12), MessageBoxButtons.OK ); } }; } ); DemographicsTaskTab.RemoveFromAllowedTabs(); ShowTab(ImpRecogTaskTab); }
private void AdvanceToImplicitRecognitionTask() { this.Tabs.Controls.Add(this.ImpRecogTaskTab); LogicEngine.InitializeImplicitRecognitionTask(); ImpRecogControls .ForEach ( control => { control.RecognitionRound = LogicEngine.ImplicitRecognitionTask.Rounds[ImpRecogControls.IndexOf(control)]; control.PictureBox.Image = control.RecognitionRound.Persona.Image; control.Radio1.Visible = false; control.Radio2.Text = "Choose"; control.Radio3.Text = "Discard"; control.Radio2.CheckedChanged += (sender, e) => { int countChecked = ImpRecogControls.Count <RecognitionUserControl>(ruc => ruc.Radio2.Checked == true); if (countChecked < 12) { ImpRecogSubmitButton.Enabled = false; } else if (countChecked == 12) { ImpRecogSubmitButton.Enabled = true; } else if (countChecked > 12) { ImpRecogSubmitButton.Enabled = false; ShowMessageBoxForImplicitRecognitionTaskImproperSelectionsFeedback(countChecked); } }; } ); DemographicsTaskTab.RemoveFromAllowedTabs(); ShowTab(ImpRecogTaskTab); }