1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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 Metis.AutoAnalysis
- {
- public partial class AddSampleStageDialog : Form
- {
- Dictionary<string, SampleStageModel> _list;
- public AddSampleStageDialog(Dictionary<string, SampleStageModel> list)
- {
- InitializeComponent();
- _list = list;
- }
- public Action<string> CallBack;
- private void button1_Click(object sender, EventArgs e)
- {
- var name = textBox1.Text.Trim();
- if (!string.IsNullOrEmpty(name))
- {
- if (_list.Keys.Contains(name))
- {
- MessageBox.Show("重复命名");
- }
- else
- {
- CallBack.Invoke(name);
- Close();
- }
- }
- else
- {
- MessageBox.Show("名字不能为空");
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Close();
- }
- }
- }
|