46 lines
783 B
C#
46 lines
783 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace friction
|
|
{
|
|
public partial class NewPreference : Form
|
|
{
|
|
MainForm m_Owner = null;
|
|
|
|
public NewPreference(MainForm owner)
|
|
{
|
|
m_Owner = owner;
|
|
|
|
InitializeComponent();
|
|
|
|
this.AcceptButton = btnAdd;
|
|
tbName.Select();
|
|
}
|
|
|
|
private void btnAdd_Click(object sender, EventArgs e)
|
|
{
|
|
if (tbName.Text.Length == 0)
|
|
{
|
|
MessageBox.Show("Please enter new preference's name");
|
|
}
|
|
else
|
|
{
|
|
m_Owner.OnPreferenceAdd(tbName.Text);
|
|
Close();
|
|
}
|
|
}
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
}
|