-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheauthUpgradeForm.cs
59 lines (50 loc) · 1.69 KB
/
eauthUpgradeForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using Eauth;
using System.Windows.Forms;
namespace Eauth_CS_Winform
{
public partial class eauthUpgradeForm : Form
{
EauthPrimaryClass eauthClass = new EauthPrimaryClass(); // Creates a new instance of the "EauthPrimaryClass" class and assigns it to the "eauthClass" variable
public eauthUpgradeForm()
{
InitializeComponent();
}
private void loginInsteadButton_Click(object sender, EventArgs e)
{
// Create an instance of the new form
eauthLoginFormUP loginForm = new eauthLoginFormUP();
// Hide the current form
this.Hide();
// Show the new form
loginForm.ShowDialog();
// Close the current form
this.Close();
}
private void exitButton_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
private async void eauthUpgradeForm_Load(object sender, EventArgs e)
{
if (await eauthClass.InitRequest() == false)
{
MessageBox.Show(EauthPrimaryClass.errorMessage);
}
}
private async void upgradeButton_Click(object sender, EventArgs e)
{
upgradeButton.Enabled = false;
if (await eauthClass.UpgradeRequest(nameInput.Text, keyInput.Text))
{
// Code block executed if credentials are valid:
MessageBox.Show("The account has been successfully upgraded.");
}
else
{
MessageBox.Show(EauthPrimaryClass.errorMessage);
}
upgradeButton.Enabled = true;
}
}
}