2021-10-17 16:18:45 +00:00
|
|
|
|
using DarkUI.Forms;
|
2021-12-14 05:40:07 +00:00
|
|
|
|
using MSFSPopoutPanelManager.UIController;
|
2021-10-17 16:18:45 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2021-12-14 05:40:07 +00:00
|
|
|
|
namespace MSFSPopoutPanelManager.UI
|
2021-10-17 16:18:45 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class AddProfileForm : DarkForm
|
|
|
|
|
{
|
2021-12-14 05:40:07 +00:00
|
|
|
|
public AddProfileForm()
|
2021-10-17 16:18:45 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-14 05:40:07 +00:00
|
|
|
|
public string ProfileName { get { return textBoxProfileName.Text.Trim(); } }
|
|
|
|
|
|
2021-10-17 16:18:45 +00:00
|
|
|
|
private void textBoxProfileName_KeyPress(object sender, KeyPressEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
e.Handled = !(Char.IsLetterOrDigit(e.KeyChar) ||
|
|
|
|
|
Char.IsPunctuation(e.KeyChar) ||
|
|
|
|
|
e.KeyChar == (char)Keys.Space ||
|
|
|
|
|
e.KeyChar == (char)Keys.Back);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void textBoxProfileName_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
buttonOK.Enabled = textBoxProfileName.Text.Trim().Length > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2021-12-14 05:40:07 +00:00
|
|
|
|
DialogResult = DialogResult.Cancel;
|
|
|
|
|
Close();
|
2021-10-17 16:18:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonOK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2021-12-14 05:40:07 +00:00
|
|
|
|
DialogResult = DialogResult.OK;
|
|
|
|
|
Close();
|
2021-10-17 16:18:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-14 05:40:07 +00:00
|
|
|
|
}
|