Exemplo n.º 1
0
        private ComplicatedWiresModule.Wire GetWireStatus(int whichWire)
        {
            ComplicatedWiresModule.Wire wireInfo = new ComplicatedWiresModule.Wire();

            if (whichWire == 1)
            {
                if (led1CheckBox.Checked)
                {
                    wireInfo.ledIsOn = true;
                }
                if (red1CheckBox.Checked)
                {
                    wireInfo.hasRedColoring = true;
                }
                if (blue1CheckBox.Checked)
                {
                    wireInfo.hasBlueColoring = true;
                }
                if (star1CheckBox.Checked)
                {
                    wireInfo.hasStarSymbol = true;
                }
            }
            else if (whichWire == 2)
            {
                if (led2CheckBox.Checked)
                {
                    wireInfo.ledIsOn = true;
                }
                if (red2CheckBox.Checked)
                {
                    wireInfo.hasRedColoring = true;
                }
                if (blue2CheckBox.Checked)
                {
                    wireInfo.hasBlueColoring = true;
                }
                if (star2CheckBox.Checked)
                {
                    wireInfo.hasStarSymbol = true;
                }
            }
            else if (whichWire == 3)
            {
                if (led3CheckBox.Checked)
                {
                    wireInfo.ledIsOn = true;
                }
                if (red3CheckBox.Checked)
                {
                    wireInfo.hasRedColoring = true;
                }
                if (blue3CheckBox.Checked)
                {
                    wireInfo.hasBlueColoring = true;
                }
                if (star3CheckBox.Checked)
                {
                    wireInfo.hasStarSymbol = true;
                }
            }
            else if (whichWire == 4)
            {
                if (led4CheckBox.Checked)
                {
                    wireInfo.ledIsOn = true;
                }
                if (red4CheckBox.Checked)
                {
                    wireInfo.hasRedColoring = true;
                }
                if (blue4CheckBox.Checked)
                {
                    wireInfo.hasBlueColoring = true;
                }
                if (star4CheckBox.Checked)
                {
                    wireInfo.hasStarSymbol = true;
                }
            }
            else if (whichWire == 5)
            {
                if (led5CheckBox.Checked)
                {
                    wireInfo.ledIsOn = true;
                }
                if (red5CheckBox.Checked)
                {
                    wireInfo.hasRedColoring = true;
                }
                if (blue5CheckBox.Checked)
                {
                    wireInfo.hasBlueColoring = true;
                }
                if (star5CheckBox.Checked)
                {
                    wireInfo.hasStarSymbol = true;
                }
            }
            else if (whichWire == 6)
            {
                if (led6CheckBox.Checked)
                {
                    wireInfo.ledIsOn = true;
                }
                if (red6CheckBox.Checked)
                {
                    wireInfo.hasRedColoring = true;
                }
                if (blue6CheckBox.Checked)
                {
                    wireInfo.hasBlueColoring = true;
                }
                if (star6CheckBox.Checked)
                {
                    wireInfo.hasStarSymbol = true;
                }
            }

            return(wireInfo);
        }
Exemplo n.º 2
0
        private void DisplayAnswerForWire(int whichWire)
        {
            ComplicatedWiresModule.Wire wireInfo =
                complicatedWiresModule.GetWire(whichWire);

            if (whichWire == 1)
            {
                if (wireInfo.shouldBeCut)
                {
                    richTextBox1.Clear();
                    richTextBox1.SelectionColor = Color.Red;
                    richTextBox1.AppendText("CUT");
                }
                else
                {
                    richTextBox1.Clear();
                    richTextBox1.SelectionColor = Color.LimeGreen;
                    richTextBox1.AppendText("DON'T\nCUT");
                }
            }
            else if (whichWire == 2)
            {
                if (wireInfo.shouldBeCut)
                {
                    richTextBox2.Clear();
                    richTextBox2.SelectionColor = Color.Red;
                    richTextBox2.AppendText("CUT");
                }
                else
                {
                    richTextBox2.Clear();
                    richTextBox2.SelectionColor = Color.LimeGreen;
                    richTextBox2.AppendText("DON'T\nCUT");
                }
            }
            else if (whichWire == 3)
            {
                if (wireInfo.shouldBeCut)
                {
                    richTextBox3.Clear();
                    richTextBox3.SelectionColor = Color.Red;
                    richTextBox3.AppendText("CUT");
                }
                else
                {
                    richTextBox3.Clear();
                    richTextBox3.SelectionColor = Color.LimeGreen;
                    richTextBox3.AppendText("DON'T\nCUT");
                }
            }
            else if (whichWire == 4)
            {
                if (wireInfo.shouldBeCut)
                {
                    richTextBox4.Clear();
                    richTextBox4.SelectionColor = Color.Red;
                    richTextBox4.AppendText("CUT");
                }
                else
                {
                    richTextBox4.Clear();
                    richTextBox4.SelectionColor = Color.LimeGreen;
                    richTextBox4.AppendText("DON'T\nCUT");
                }
            }
            else if (whichWire == 5)
            {
                if (wireInfo.shouldBeCut)
                {
                    richTextBox5.Clear();
                    richTextBox5.SelectionColor = Color.Red;
                    richTextBox5.AppendText("CUT");
                }
                else
                {
                    richTextBox5.Clear();
                    richTextBox5.SelectionColor = Color.LimeGreen;
                    richTextBox5.AppendText("DON'T\nCUT");
                }
            }
            else if (whichWire == 6)
            {
                if (wireInfo.shouldBeCut)
                {
                    richTextBox6.Clear();
                    richTextBox6.SelectionColor = Color.Red;
                    richTextBox6.AppendText("CUT");
                }
                else
                {
                    richTextBox6.Clear();
                    richTextBox6.SelectionColor = Color.LimeGreen;
                    richTextBox6.AppendText("DON'T\nCUT");
                }
            }

            DisplayWarnings();
        }