Exemplo n.º 1
0
 /// <summary>
 /// When the AdditionalInputBox is clicked, it removes the example text and sets color of font to app default.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AddtionalInputTxtBox_Click(object sender, EventArgs e)
 {
     AdditionalInputTxtBox.ForeColor = Color.White;
     if (AdditionalInputTxtBox.Text == arrayInputEx)
     {
         AdditionalInputTxtBox.Clear();
     }
     if (AdditionalInputTxtBox.BackColor == Color.FromArgb(236, 188, 188))
     {
         AdditionalInputTxtBox.BackColor = Color.FromArgb(44, 44, 44);
     }
 }
Exemplo n.º 2
0
        private void AlgoListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            AdditionalInputLabel.Visible  = false;
            AdditionalInputTxtBox.Visible = false;
            AnswerTxtBox.Clear();
            UserInputBox.Clear();
            AdditionalInputTxtBox.Clear();
            currentSelection = AlgoListBox.SelectedItem.ToString();

            switch (AlgoListBox.SelectedItem.ToString())
            {
            case "Find three largest numbers in array":
                UserInputLabel.Text    = arrayInputLabel;
                UserInputBox.ForeColor = Color.Gray;
                UserInputBox.Text      = arrayInputEx;

                InstructionTxtBox.Text = Properties.Resources.FindThreeLargestNumsInfoTxt;                                                                         //CodePreviewBox.Text = TextConnector.FullFilePath("FindThreeLargestNumsCode.txt").LoadFile();
                CodePreviewBox.Text    = Properties.Resources.FindThreeLargestNumsInfoTxt;
                break;

            case "Move elements in array to end":
                AdditionalInputLabel.Visible  = true;
                AdditionalInputTxtBox.Visible = true;
                AdditionalInputLabel.Text     = "Enter an integer that is in the first array";
                UserInputLabel.Text           = arrayInputLabel;
                UserInputBox.ForeColor        = Color.Gray;
                UserInputBox.Text             = arrayInputEx;

                InstructionTxtBox.Text = Properties.Resources.MoveToEndInfoTxt;
                CodePreviewBox.Text    = Properties.Resources.MoveToEndCode;
                break;

            case "Palindrome validator":
                UserInputLabel.Text    = "Enter possible Palindrome";
                InstructionTxtBox.Text = Properties.Resources.PalindromeCheckerInfoTxt;
                CodePreviewBox.Text    = Properties.Resources.PalindromeCheckerCode;
                break;

            case "Sub sequence validator":

                AdditionalInputLabel.Visible  = true;
                AdditionalInputTxtBox.Visible = true;

                UserInputLabel.Text    = arrayInputLabel;
                UserInputBox.Text      = arrayInputEx;
                UserInputBox.ForeColor = Color.Gray;

                AdditionalInputLabel.Text       = "Enter potential subsequence";
                AdditionalInputTxtBox.Text      = arrayInputEx;
                AdditionalInputTxtBox.ForeColor = Color.Gray;

                InstructionTxtBox.Text = Properties.Resources.SubsequenceInfoTxt;
                CodePreviewBox.Text    = Properties.Resources.SubsetCheckerCode;
                break;

            case "Nth Fibonacci":

                UserInputLabel.Text    = "Enter integer ";
                InstructionTxtBox.Text = Properties.Resources.NthFibonacciInfoTxt;
                CodePreviewBox.Text    = Properties.Resources.NthFibonacciCode;
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
 private void ClearButton_Click(object sender, EventArgs e)
 {
     UserInputBox.Clear();
     AnswerTxtBox.Clear();
     AdditionalInputTxtBox.Clear();
 }