private void button2_Click(object sender, EventArgs e) { Coder code = new Coder(); var text = textBox2.Text; var encoded = ""; if (!string.IsNullOrEmpty(text)) { encoded = code.Encode(text); textBox2.Text = encoded; } else { MessageBox.Show("Введите текст для дешифрования!"); } }
private void button1_Click(object sender, EventArgs e) { Coder code = new Coder(); var textToCode = textBox1.Text; var codedText = ""; if (!string.IsNullOrEmpty(textToCode)) { codedText = code.Code(textToCode); textBox2.Text = codedText; } else { MessageBox.Show("Введите текст для шифрования!"); } }