12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using PaintDotNet;
- 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;
- this.Load += (s, e) => InitializeText();
- }
- public void InitializeText()
- {
- this.Text = PdnResources.GetString("AutoAnalysis.StageNameModify");
- groupBox1.Text = PdnResources.GetString("AutoAnalysis.StageName");
- groupBox2.Text = PdnResources.GetString("AutoAnalysis.Operate");
- label1.Text = PdnResources.GetString("AutoAnalysis.Name");
- button1.Text = PdnResources.GetString("AutoAnalysis.Button.OK");
- button2.Text = PdnResources.GetString("AutoAnalysis.Button.Cancel");
- }
- 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();
- }
- }
- }
|