Exemplo n.º 1
0
        private void TranslateButton_Click(object sender, EventArgs e)
        {
            var validString = EnglishRichTextBox.Text;

            if (!validString.Equals("") && !validString.Equals(" "))
            {
                TranslateRichTextBox.Clear();
                if (PigLatinRadio.Checked)
                {
                    PigLatinTranslator pigLatin = new PigLatinTranslator();
                    var translated = pigLatin.PigLatin(validString);
                    foreach (var word in translated)
                    {
                        TranslateRichTextBox.Text += $"{word} ";
                    }
                }
                else if (PigGreekRadio.Checked)
                {
                    PigGreekTranslator pigGreek = new PigGreekTranslator();
                    var translated = pigGreek.PigGreek(validString);
                    foreach (var word in translated)
                    {
                        TranslateRichTextBox.Text += $"{word} ";
                    }
                }
            } //else text field is blank, doNothing();
        }
Exemplo n.º 2
0
 private void ClearButton_Click(object sender, EventArgs e)
 {
     TranslateRichTextBox.Clear();
     EnglishRichTextBox.Clear();
 }
Exemplo n.º 3
0
 private void PigGreekRadio_Click(object sender, EventArgs e)
 {
     TranslateLabel.Text = "Pig Greek Translation:";
     TranslateRichTextBox.Clear();
 }