Projektdateien hinzufügen.

This commit is contained in:
Schedel Pascal
2024-08-22 06:25:24 +02:00
parent 239f22b74f
commit a9e18dd127
14 changed files with 2302 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
using Pilz.Cryptography;
using Pilz.Tools.Symbols;
using Telerik.WinControls.UI;
namespace Pilz.Tools.StringCrypter;
public partial class Form1 : RadForm
{
private ICrypter? crypter;
public Form1()
{
InitializeComponent();
radButton_Copy.SvgImage = GlobalSymbolFactory.Instance.GetSvgImage(GlobalSymbols.copy, UI.Symbols.SymbolSize.x16);
radButton_Paste.SvgImage = GlobalSymbolFactory.Instance.GetSvgImage(GlobalSymbols.paste_as_text, UI.Symbols.SymbolSize.x16);
}
private void RadButton_Copy_Click(object sender, EventArgs e)
{
Clipboard.SetText(radTextBox_Output.Text);
}
private void RadButton_Paste_Click(object sender, EventArgs e)
{
radTextBox_Input.Text = Clipboard.GetText();
}
private void RadToggleSwitch_Mode_ValueChanged(object sender, EventArgs e)
{
DoEncryption();
}
private void RadTextBox_Key_TextChanged(object sender, EventArgs e)
{
crypter = null;
DoEncryption();
}
private void RadTextBox_Input_TextChanged(object sender, EventArgs e)
{
DoEncryption();
}
private void DoEncryption()
{
crypter ??= new SimpleStringCrypter(radTextBox_Key.Text);
try
{
if (radToggleSwitch_Mode.Value)
radTextBox_Output.Text = crypter.Encrypt(radTextBox_Input.Text);
else
radTextBox_Output.Text = crypter.Decrypt(radTextBox_Input.Text);
}
catch (Exception)
{
radTextBox_Output.Text = null;
}
}
}