2020-03-13 22:35:20 +00:00
|
|
|
|
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 UWUVCI_AIO_WPF.UI.Windows
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaktionslogik für EnterKey.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class EnterKey : Window
|
|
|
|
|
{
|
2020-03-31 23:48:50 +00:00
|
|
|
|
bool ckey = false;
|
|
|
|
|
public EnterKey(bool ckey)
|
2020-03-13 22:35:20 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2020-03-31 23:48:50 +00:00
|
|
|
|
this.ckey = ckey;
|
|
|
|
|
if (ckey)
|
|
|
|
|
{
|
|
|
|
|
region.Visibility = Visibility.Hidden;
|
|
|
|
|
Key.Text = "CommonKey";
|
|
|
|
|
}
|
2020-03-13 22:35:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click_1(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2020-03-31 23:48:50 +00:00
|
|
|
|
if (ckey)
|
|
|
|
|
{
|
|
|
|
|
MainViewModel mvm = (MainViewModel)FindResource("mvm");
|
|
|
|
|
if (mvm.checkcKey(tbKey.Text))
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
2020-04-06 20:05:10 +00:00
|
|
|
|
MessageBox.Show("The entered CommonKey is correct!", "Correct Key", MessageBoxButton.OK, MessageBoxImage.Information);
|
2020-04-06 23:33:46 +00:00
|
|
|
|
mvm.ArePathsSet();
|
2020-04-06 20:05:10 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("The entered CommonKey is incorrect!", "Incorrect Key", MessageBoxButton.OK, MessageBoxImage.Error);
|
2020-03-31 23:48:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2020-03-23 23:18:36 +00:00
|
|
|
|
{
|
2020-03-31 23:48:50 +00:00
|
|
|
|
MainViewModel mvm = (MainViewModel)FindResource("mvm");
|
|
|
|
|
if (mvm.checkKey(tbKey.Text))
|
|
|
|
|
{
|
2020-04-06 20:05:10 +00:00
|
|
|
|
MessageBox.Show("The entered TitleKey is correct!", "Correct Key", MessageBoxButton.OK, MessageBoxImage.Information);
|
2020-03-31 23:48:50 +00:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2020-04-06 20:05:10 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("The entered TitleKey is incorrect!", "Incorrect Key", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
|
|
}
|
2020-03-23 23:18:36 +00:00
|
|
|
|
}
|
2020-03-31 23:48:50 +00:00
|
|
|
|
|
2020-03-13 22:35:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|