using System;
using System.Collections;
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 PaintDotNet.DedicatedAnalysis.QuantitativeAnalysis
{
public partial class BandedTissueSaveDialog : Form
{
#region 控件
private Label label1;
private TextBox textBox1;
private Button button1;
private Button button2;
private Label label2;
#endregion
///
/// 已有的网格
///
private List grids;
public BandedTissueSaveDialog(List grids)
{
this.grids = grids;
InitializeComponent();
InitializeLanguageText();
}
#region 初始化
private void InitializeLanguageText()
{
this.label1.Text = PdnResources.GetString("Menu.name.text") + ":";
this.label2.Text = "------------------------------------------------------------";
this.button1.Text = PdnResources.GetString("Menu.File.Close.Text");
this.button2.Text = PdnResources.GetString("CommonAction.Save");
this.Text = PdnResources.GetString("CommonAction.Save");
}
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(15, 19);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 0;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(61, 15);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(277, 21);
this.textBox1.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(-3, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(365, 12);
this.label2.TabIndex = 2;
//
// button1
//
this.button1.BackColor = System.Drawing.SystemColors.Control;
this.button1.Location = new System.Drawing.Point(182, 64);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 3;
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.SystemColors.Control;
this.button2.Location = new System.Drawing.Point(263, 64);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 4;
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// BandedTissueSaveDialog
//
this.ClientSize = new System.Drawing.Size(359, 93);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "BandedTissueSaveDialog";
this.ShowInTaskbar = false;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
///
/// 画面关闭
///
///
///
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
///
/// 保存网格
///
///
///
private void button2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.textBox1.Text))
{
MessageBox.Show(PdnResources.GetString("Menu.Pleaseenteragridname.text")+"!");
this.textBox1.Focus();
}
else
{
BandedTissueDialog bandedTissueDialog = (BandedTissueDialog)this.Owner;
if (this.grids != null)
{
if (this.grids.Contains(this.textBox1.Text))
MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
else
{
bandedTissueDialog.RefreshGridItems(this.textBox1.Text);
this.Close();
}
}
else
{
bandedTissueDialog.RefreshGridItems(this.textBox1.Text);
this.Close();
}
}
}
}
}