Squashed 'FSI.Lib/' content from commit 6aa4846
git-subtree-dir: FSI.Lib git-subtree-split: 6aa48465a834a7bfdd9cbeae8d2e4f769d0c0ff8
This commit is contained in:
55
FSI.Lib/Guis/DeEncryptMessage/FrmMain.xaml
Normal file
55
FSI.Lib/Guis/DeEncryptMessage/FrmMain.xaml
Normal file
@@ -0,0 +1,55 @@
|
||||
<Window x:Class="FSI.Lib.Guis.DeEncryptMessage.FrmMain"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FSI.Lib.Guis.DeEncryptMessage"
|
||||
mc:Ignorable="d"
|
||||
Title="FSI Message Ent-/Verschlüsseln"
|
||||
SizeToContent="WidthAndHeight"
|
||||
Height="Auto"
|
||||
Width="Auto"
|
||||
Icon="../../Icons/FondiumU.ico">
|
||||
|
||||
<Grid MinWidth="300">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="100" />
|
||||
<RowDefinition MinHeight="100" />
|
||||
<RowDefinition MaxHeight="30"
|
||||
Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBox x:Name="tbInput"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
|
||||
<TextBox x:Name="tboutput"
|
||||
Grid.Row="1"
|
||||
AcceptsReturn="True"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Grid.Row="2">
|
||||
<Button x:Name="btnCrypt"
|
||||
Content="verschlüsseln"
|
||||
Margin="5 5 5 5 "
|
||||
Click="btnCrypt_Click" />
|
||||
<Button x:Name="btnDeCrypt"
|
||||
Content="entschlüsseln"
|
||||
Margin="5 5 5 5 "
|
||||
Click="btnDeCrypt_Click" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<StatusBar Grid.Row="3">
|
||||
<StatusBarItem HorizontalAlignment="Right">
|
||||
<TextBlock Text="{Binding CurrentTime}" />
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
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