Squashed 'FSI.Lib/' content from commit 6aa4846
git-subtree-dir: FSI.Lib git-subtree-split: 6aa48465a834a7bfdd9cbeae8d2e4f769d0c0ff8
This commit is contained in:
61
FSI.Lib/Guis/DeEncryptMessage/FrmMain.xaml.cs
Normal file
61
FSI.Lib/Guis/DeEncryptMessage/FrmMain.xaml.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace FSI.Lib.Guis.DeEncryptMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für FrmMain.xaml
|
||||
/// </summary>
|
||||
public partial class FrmMain : Window
|
||||
{
|
||||
public string Password { get; set; }
|
||||
public bool CloseAtLostFocus { get; set; }
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
Deactivated += FrmMain_Deactivated;
|
||||
DataContext = new MVVM.ViewModel.CurrentTimeViewModel();
|
||||
}
|
||||
|
||||
private void FrmMain_Deactivated(object sender, System.EventArgs e)
|
||||
{
|
||||
if (CloseAtLostFocus)
|
||||
Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
private void btnDeCrypt_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
tboutput.Text = DeEncryptString.DeEncrypt.DecryptString(tbInput.Text, Password);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Text kann nicht entschlüsselt werden!", "Achtung", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCrypt_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
tboutput.Text = DeEncryptString.DeEncrypt.CryptString(tbInput.Text, Password);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Text kann nicht verschlüsselt werden!", "Achtung", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user