Squashed 'FSI.Lib/' content from commit 6aa4846
git-subtree-dir: FSI.Lib git-subtree-split: 6aa48465a834a7bfdd9cbeae8d2e4f769d0c0ff8
This commit is contained in:
79
FSI.Lib/Guis/AutoPw/FrmMain.xaml.cs
Normal file
79
FSI.Lib/Guis/AutoPw/FrmMain.xaml.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
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.AutoPw
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für FrmMain.xaml
|
||||
/// </summary>
|
||||
public partial class FrmMain : Window
|
||||
{
|
||||
public bool CloseAtLostFocus { get; set; }
|
||||
public bool PwOk { get; set; }
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BtnOk.IsEnabled = false;
|
||||
Deactivated += FrmMain_Deactivated;
|
||||
DataContext = new MVVM.ViewModel.CurrentTimeViewModel();
|
||||
}
|
||||
|
||||
private void FrmMain_Deactivated(object sender, System.EventArgs e)
|
||||
{
|
||||
if (CloseAtLostFocus)
|
||||
Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
private void BtnOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void BtnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
PwOk = false;
|
||||
}
|
||||
|
||||
|
||||
private void TbPw_PasswordChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (((PasswordBox)sender).Password.Equals(DateTime.Now.ToString("yyyyMMdd")))
|
||||
{
|
||||
BtnOk.IsEnabled = true;
|
||||
PwOk = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BtnOk.IsEnabled = false;
|
||||
PwOk = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void TbPw_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (BtnOk.IsEnabled == true)
|
||||
{
|
||||
PwOk = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PwOk = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user