123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- 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
- /// <summary>
- /// 已有的网格
- /// </summary>
- private List<string> grids;
- public BandedTissueSaveDialog(List<string> 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
- /// <summary>
- /// 画面关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 保存网格
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- }
- }
- }
- }
|