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 SA_LTT_UI.Viewer
|
{
|
public partial class FoupRecipeCreateViewer : Form
|
{
|
public string RecipeName { get; set; }
|
|
public FoupRecipeCreateViewer()
|
{
|
InitializeComponent();
|
RecipeName = string.Empty;
|
}
|
|
private void btn_Ok_Click(object sender, EventArgs e)
|
{
|
if (RecipeName == string.Empty)
|
{
|
MessageBoxPad messageBox = new MessageBoxPad("이름이 비어있습니다.");
|
messageBox.Show();
|
}
|
else
|
{
|
char[] nameExceptList = new char[] { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
|
|
foreach (char exceptChar in nameExceptList)
|
{
|
if (RecipeName.Contains(exceptChar))
|
{
|
MessageBoxPad messageBox = new MessageBoxPad("파일 이름에는 다음 문자를 사용할 수 없습니다. \r\n \\ / : * ? \" < > | ");
|
messageBox.Show();
|
return;
|
}
|
}
|
|
DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
|
private void btn_Cancel_Click(object sender, EventArgs e)
|
{
|
RecipeName = string.Empty;
|
DialogResult = DialogResult.Cancel;
|
this.Close();
|
}
|
|
private void tb_Name_Leave(object sender, EventArgs e)
|
{
|
SetSettingData(sender);
|
}
|
|
private void tb_Name_KeyDown(object sender, KeyEventArgs e)
|
{
|
if (e.KeyData == Keys.Enter)
|
{
|
SetSettingData(sender);
|
}
|
}
|
|
private void SetSettingData(object sender)
|
{
|
Control control = (Control)sender;
|
|
switch (control.Name)
|
{
|
case "tb_Name":
|
{
|
RecipeName = control.Text;
|
break;
|
}
|
}
|
}
|
}
|
}
|