mirror of
https://github.com/kwsch/pkNX.git
synced 2026-08-20 09:24:06 -05:00
Cumulative changes from the team. Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com> Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com> Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
31 lines
718 B
C#
31 lines
718 B
C#
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace pkNX.WinForms;
|
|
|
|
public partial class TextInput : Form
|
|
{
|
|
public string Result { get; set; } = string.Empty;
|
|
private readonly Func<string, bool>? Validator;
|
|
|
|
public TextInput(Func<string, bool>? validator = null)
|
|
{
|
|
Validator = validator;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Input_TextChanged(object sender, EventArgs e)
|
|
{
|
|
Result = Input.Text;
|
|
if (Validator != null)
|
|
B_Export.ForeColor = Validator(Result) ? Color.Green : Color.Red;
|
|
}
|
|
|
|
private void B_Export_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult = DialogResult.OK;
|
|
Close();
|
|
}
|
|
}
|