예제 #1
0
 private void ChangeCipherText()
 {
     try {
         textBox_CipherText.Text      = Base64Translator.EncryptBase64(textBox_ClearText.Text, GetSelectedEncoding());
         textBox_CipherText.IsEnabled = true;
     } catch (FormatException) {
         textBox_CipherText.Text      = "Invalid clear text.";
         textBox_CipherText.IsEnabled = false;
     }
 }
예제 #2
0
 private void textBox_CipherText_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (textBox_CipherText.IsFocused)
     {
         try {
             textBox_ClearText.Text      = Base64Translator.DecryptBase64(textBox_CipherText.Text, GetSelectedEncoding());
             textBox_ClearText.IsEnabled = true;
         } catch (FormatException) {
             textBox_ClearText.Text      = "Invalid cipher text.";
             textBox_ClearText.IsEnabled = false;
         }
     }
 }