Example #1
0
        private void DecipherButton_Click(object sender, EventArgs e)
        {
            string inputText = CipherBox.Text;

            if (inputText.Length == 0)
            {
                return;
            }

            if (ShiftAll.Checked)
            {
                PlainBox.Clear();

                for (int i = 1; i < 26; i++)
                {
                    PlainBox.Text += Caesar.Decipher(inputText, i);

                    if (i != 25)
                    {
                        PlainBox.Text += Environment.NewLine;
                    }
                }
            }
            else
            {
                PlainBox.Text = Caesar.Decipher(inputText, (int)ShiftInput.Value);
            }
        }