DiscordMediaLoader/Discord Media Loader/LoginForm.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2017-01-28 17:17:19 +01:00
using System;
using System.Windows.Forms;
2017-03-08 18:30:57 +01:00
using Discord_Media_Loader.Helper;
2017-01-28 17:17:19 +01:00
namespace Discord_Media_Loader
{
public partial class LoginForm : Form
{
public static bool Exec(ref string email, out string password)
{
var loginForm = new LoginForm { tbxEmail = { Text = email } };
password = "";
if (loginForm.ShowDialog() == DialogResult.OK)
{
email = loginForm.tbxEmail.Text;
password = loginForm.tbxPassword.Text;
return true;
}
return false;
}
public LoginForm()
{
InitializeComponent();
}
private void btnAbort_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Abort;
}
private void btnLogin_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
2017-01-28 17:50:56 +01:00
private void tbx_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Return)
DialogResult = DialogResult.OK;
else if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Abort;
}
2017-01-28 17:17:19 +01:00
}
}