123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107 |
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.CustomControl;
- using PaintDotNet.Base.SettingModel;
- using System;
- using System.Drawing;
- using System.IO;
- using System.Windows.Forms;
- using System.Collections.Generic;
- namespace PaintDotNet.Setting
- {
- /// <summary>
- /// 设置->网格设置
- /// </summary>
- internal partial class GridSettingDialog : PdnBaseForm
- {
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.GroupBox groupBox3;
- private System.Windows.Forms.GroupBox groupBox4;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.ComboBox comboBox1;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.ComboBox comboBox2;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Panel gridPanel;
- private System.Windows.Forms.Panel rectPanel;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.Label label10;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.ComboBox comboBox4;
- private System.Windows.Forms.ComboBox comboBox3;
- private System.Windows.Forms.Panel circularPanel;
- private System.Windows.Forms.Label label11;
- private System.Windows.Forms.Label label12;
- private System.Windows.Forms.ComboBox comboBox5;
- private System.Windows.Forms.ComboBox comboBox6;
- private System.Windows.Forms.Label label13;
- private System.Windows.Forms.ColorDialog colorDialog1;
- private UserTextBox userTextBox1;
- private UserTextBox userTextBox2;
- private UserTextBox userTextBox3;
- /// <summary>
- /// 主控件
- /// </summary>
- private AppWorkspace appWorkspace;
- /// <summary>
- /// 网格设置的model
- /// </summary>
- private GridModel gridModel = Startup.instance.gridModel;
- /// <summary>
- /// 单位标尺
- /// </summary>
- private double unitLength = 1;
- /// <summary>
- /// 网格调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsFormGrid;
- /// <summary>
- /// 矩形调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsFormRect;
- private ComboBox comboBox7;
- private ColorDialog colorDialog2;
- private GroupBox groupBox5;
- private Button button5;
- private Button button4;
- private Button button3;
- private DataGridView dataGridView1;
- private DataGridViewTextBoxColumn Column1;
- private Label label2;
- private TextBox textBox1;
- /// <summary>
- /// 圆形调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsFormCircular;
- private Button btnSaveAs;
- private Button btnSave;
- private Button btnDel;
- /// <summary>
- /// 网格样式的增改删,0-添加、1-修改、2-删除
- /// </summary>
- private int operation = -1;
- public GridSettingDialog(AppWorkspace appWorkspace)
- {
- this.appWorkspace = appWorkspace;
- InitializeComponent();
- InitializeLanguageText();
- InitializeButtonBackgroudImage();
- InitParameterData();
- InitializationDataGridView();
- InitializeComponent2();
- UnitData();
- }
- #region Windows Form Designer generated code
- private void InitializeLanguageText()
- {
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- //this.button2.Text = PdnResources.GetString("Menu.cancel.text");
- this.button1.Text = PdnResources.GetString("Menu.application.text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Setting.GridSetting.Text");
- this.label7.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label6.Text = PdnResources.GetString("Menu.Set.Gridsettings.grist.text") + ":";
- this.label5.Text = PdnResources.GetString("Menu.Set.Gridsettings.Linear.text") + ":";
- this.label4.Text = PdnResources.GetString("Menu.Set.Gridsettings.Numberofverticalgrids.text") + ":";
- this.label3.Text = PdnResources.GetString("Menu.Set.Gridsettings.Numberofhorizontalgrids.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.Set.Gridsettings.Gridsidelength.text") + ":";
- this.groupBox3.Text = PdnResources.GetString("Menu.Set.Gridsettings.Rectsettings.text");
- this.label8.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label10.Text = PdnResources.GetString("Menu.Set.Gridsettings.Linear.text") + ":";
- this.label9.Text = PdnResources.GetString("Menu.Set.Gridsettings.grist.text") + ":";
- this.groupBox4.Text = PdnResources.GetString("Menu.Set.Gridsettings.roundsetting.text");
- this.label11.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label12.Text = PdnResources.GetString("Menu.Set.Gridsettings.grist.text") + ":";
- this.label13.Text = PdnResources.GetString("Menu.Set.Gridsettings.Linear.text") + ":";
- this.Text = PdnResources.GetString("Menu.Setting.GridSetting.Text");
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.btnSaveAs = new System.Windows.Forms.Button();
- this.btnSave = new System.Windows.Forms.Button();
- this.btnDel = new System.Windows.Forms.Button();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.comboBox7 = new System.Windows.Forms.ComboBox();
- this.userTextBox3 = new PaintDotNet.CustomControl.UserTextBox();
- this.userTextBox2 = new PaintDotNet.CustomControl.UserTextBox();
- this.userTextBox1 = new PaintDotNet.CustomControl.UserTextBox();
- this.gridPanel = new System.Windows.Forms.Panel();
- this.label7 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.comboBox2 = new System.Windows.Forms.ComboBox();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.label5 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.rectPanel = new System.Windows.Forms.Panel();
- this.label8 = new System.Windows.Forms.Label();
- this.label10 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.comboBox4 = new System.Windows.Forms.ComboBox();
- this.comboBox3 = new System.Windows.Forms.ComboBox();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.circularPanel = new System.Windows.Forms.Panel();
- this.label11 = new System.Windows.Forms.Label();
- this.label12 = new System.Windows.Forms.Label();
- this.comboBox5 = new System.Windows.Forms.ComboBox();
- this.comboBox6 = new System.Windows.Forms.ComboBox();
- this.label13 = new System.Windows.Forms.Label();
- this.colorDialog1 = new System.Windows.Forms.ColorDialog();
- this.colorDialog2 = new System.Windows.Forms.ColorDialog();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.button5 = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.groupBox4.SuspendLayout();
- this.groupBox5.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.btnSaveAs);
- this.groupBox1.Controls.Add(this.btnSave);
- this.groupBox1.Controls.Add(this.btnDel);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(691, 58);
- this.groupBox1.TabIndex = 1;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "操作";
- //
- // btnSaveAs
- //
- this.btnSaveAs.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.btnSaveAs.Location = new System.Drawing.Point(520, 20);
- this.btnSaveAs.Name = "btnSaveAs";
- this.btnSaveAs.Size = new System.Drawing.Size(75, 23);
- this.btnSaveAs.TabIndex = 3;
- this.btnSaveAs.Text = "另存为";
- this.btnSaveAs.UseVisualStyleBackColor = true;
- this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click);
- //
- // btnSave
- //
- this.btnSave.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.btnSave.Location = new System.Drawing.Point(439, 20);
- this.btnSave.Name = "btnSave";
- this.btnSave.Size = new System.Drawing.Size(75, 23);
- this.btnSave.TabIndex = 2;
- this.btnSave.Text = "保存";
- this.btnSave.UseVisualStyleBackColor = true;
- this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
- //
- // btnDel
- //
- this.btnDel.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.btnDel.Location = new System.Drawing.Point(358, 20);
- this.btnDel.Name = "btnDel";
- this.btnDel.Size = new System.Drawing.Size(75, 23);
- this.btnDel.TabIndex = 1;
- this.btnDel.Text = "删除";
- this.btnDel.UseVisualStyleBackColor = true;
- this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
- //
- // button1
- //
- this.button1.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.button1.Location = new System.Drawing.Point(601, 20);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 0;
- this.button1.Text = "激活";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.textBox1);
- this.groupBox2.Controls.Add(this.label2);
- this.groupBox2.Controls.Add(this.comboBox7);
- this.groupBox2.Controls.Add(this.userTextBox3);
- this.groupBox2.Controls.Add(this.userTextBox2);
- this.groupBox2.Controls.Add(this.userTextBox1);
- this.groupBox2.Controls.Add(this.gridPanel);
- this.groupBox2.Controls.Add(this.label7);
- this.groupBox2.Controls.Add(this.label6);
- this.groupBox2.Controls.Add(this.comboBox2);
- this.groupBox2.Controls.Add(this.comboBox1);
- this.groupBox2.Controls.Add(this.label5);
- this.groupBox2.Controls.Add(this.label4);
- this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Controls.Add(this.label1);
- this.groupBox2.Location = new System.Drawing.Point(195, 77);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(508, 207);
- this.groupBox2.TabIndex = 2;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "网格设置";
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(107, 13);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(342, 21);
- this.textBox1.TabIndex = 20;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(59, 18);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(41, 12);
- this.label2.TabIndex = 16;
- this.label2.Text = "名称:";
- //
- // comboBox7
- //
- this.comboBox7.FormattingEnabled = true;
- this.comboBox7.Items.AddRange(new object[] {
- "px",
- "μm"});
- this.comboBox7.Location = new System.Drawing.Point(400, 42);
- this.comboBox7.Name = "comboBox7";
- this.comboBox7.Size = new System.Drawing.Size(49, 20);
- this.comboBox7.TabIndex = 2;
- //
- // userTextBox3
- //
- this.userTextBox3.Location = new System.Drawing.Point(107, 100);
- this.userTextBox3.Name = "userTextBox3";
- this.userTextBox3.Size = new System.Drawing.Size(342, 21);
- this.userTextBox3.TabIndex = 15;
- //
- // userTextBox2
- //
- this.userTextBox2.Location = new System.Drawing.Point(107, 72);
- this.userTextBox2.Name = "userTextBox2";
- this.userTextBox2.Size = new System.Drawing.Size(342, 21);
- this.userTextBox2.TabIndex = 14;
- //
- // userTextBox1
- //
- this.userTextBox1.Location = new System.Drawing.Point(107, 42);
- this.userTextBox1.Name = "userTextBox1";
- this.userTextBox1.Size = new System.Drawing.Size(287, 21);
- this.userTextBox1.TabIndex = 13;
- //
- // gridPanel
- //
- this.gridPanel.BackColor = System.Drawing.Color.Transparent;
- this.gridPanel.Location = new System.Drawing.Point(107, 182);
- this.gridPanel.Name = "gridPanel";
- this.gridPanel.Size = new System.Drawing.Size(72, 21);
- this.gridPanel.TabIndex = 12;
- this.gridPanel.Click += new System.EventHandler(this.gridColorPanel_Click);
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(59, 186);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(41, 12);
- this.label7.TabIndex = 11;
- this.label7.Text = "颜色:";
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(59, 159);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(41, 12);
- this.label6.TabIndex = 10;
- this.label6.Text = "粗细:";
- //
- // comboBox2
- //
- this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox2.FormattingEnabled = true;
- this.comboBox2.Location = new System.Drawing.Point(107, 155);
- this.comboBox2.Name = "comboBox2";
- this.comboBox2.Size = new System.Drawing.Size(341, 20);
- this.comboBox2.TabIndex = 9;
- //
- // comboBox1
- //
- this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(107, 128);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(341, 20);
- this.comboBox1.TabIndex = 8;
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(59, 132);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(41, 12);
- this.label5.TabIndex = 7;
- this.label5.Text = "线形:";
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(11, 104);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(89, 12);
- this.label4.TabIndex = 6;
- this.label4.Text = "垂直网格数量:";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(11, 76);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(89, 12);
- this.label3.TabIndex = 3;
- this.label3.Text = "水平网格数量:";
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(35, 46);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(65, 12);
- this.label1.TabIndex = 0;
- this.label1.Text = "网格边长:";
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.rectPanel);
- this.groupBox3.Controls.Add(this.label8);
- this.groupBox3.Controls.Add(this.label10);
- this.groupBox3.Controls.Add(this.label9);
- this.groupBox3.Controls.Add(this.comboBox4);
- this.groupBox3.Controls.Add(this.comboBox3);
- this.groupBox3.Location = new System.Drawing.Point(195, 290);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(508, 100);
- this.groupBox3.TabIndex = 3;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "矩形设置";
- //
- // rectPanel
- //
- this.rectPanel.BackColor = System.Drawing.Color.Transparent;
- this.rectPanel.Location = new System.Drawing.Point(107, 73);
- this.rectPanel.Name = "rectPanel";
- this.rectPanel.Size = new System.Drawing.Size(72, 21);
- this.rectPanel.TabIndex = 18;
- this.rectPanel.Click += new System.EventHandler(this.rectColorPanel_Click);
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(59, 77);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(41, 12);
- this.label8.TabIndex = 17;
- this.label8.Text = "颜色:";
- //
- // label10
- //
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(59, 23);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(41, 12);
- this.label10.TabIndex = 13;
- this.label10.Text = "线形:";
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(59, 50);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(41, 12);
- this.label9.TabIndex = 16;
- this.label9.Text = "粗细:";
- //
- // comboBox4
- //
- this.comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox4.FormattingEnabled = true;
- this.comboBox4.Location = new System.Drawing.Point(107, 46);
- this.comboBox4.Name = "comboBox4";
- this.comboBox4.Size = new System.Drawing.Size(341, 20);
- this.comboBox4.TabIndex = 14;
- //
- // comboBox3
- //
- this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox3.FormattingEnabled = true;
- this.comboBox3.Location = new System.Drawing.Point(107, 19);
- this.comboBox3.Name = "comboBox3";
- this.comboBox3.Size = new System.Drawing.Size(341, 20);
- this.comboBox3.TabIndex = 15;
- //
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.circularPanel);
- this.groupBox4.Controls.Add(this.label11);
- this.groupBox4.Controls.Add(this.label12);
- this.groupBox4.Controls.Add(this.comboBox5);
- this.groupBox4.Controls.Add(this.comboBox6);
- this.groupBox4.Controls.Add(this.label13);
- this.groupBox4.Location = new System.Drawing.Point(195, 397);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(508, 100);
- this.groupBox4.TabIndex = 4;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "圆形设置";
- //
- // circularPanel
- //
- this.circularPanel.BackColor = System.Drawing.Color.Transparent;
- this.circularPanel.Location = new System.Drawing.Point(105, 72);
- this.circularPanel.Name = "circularPanel";
- this.circularPanel.Size = new System.Drawing.Size(72, 21);
- this.circularPanel.TabIndex = 18;
- this.circularPanel.Click += new System.EventHandler(this.circularColorPanel_Click);
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(57, 76);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(41, 12);
- this.label11.TabIndex = 17;
- this.label11.Text = "颜色:";
- //
- // label12
- //
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(57, 49);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(41, 12);
- this.label12.TabIndex = 16;
- this.label12.Text = "粗细:";
- //
- // comboBox5
- //
- this.comboBox5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox5.FormattingEnabled = true;
- this.comboBox5.Location = new System.Drawing.Point(105, 18);
- this.comboBox5.Name = "comboBox5";
- this.comboBox5.Size = new System.Drawing.Size(341, 20);
- this.comboBox5.TabIndex = 15;
- //
- // comboBox6
- //
- this.comboBox6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox6.FormattingEnabled = true;
- this.comboBox6.Location = new System.Drawing.Point(105, 44);
- this.comboBox6.Name = "comboBox6";
- this.comboBox6.Size = new System.Drawing.Size(341, 20);
- this.comboBox6.TabIndex = 14;
- //
- // label13
- //
- this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(57, 22);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(41, 12);
- this.label13.TabIndex = 13;
- this.label13.Text = "线形:";
- //
- // groupBox5
- //
- this.groupBox5.Controls.Add(this.dataGridView1);
- this.groupBox5.Controls.Add(this.button5);
- this.groupBox5.Controls.Add(this.button4);
- this.groupBox5.Controls.Add(this.button3);
- this.groupBox5.Location = new System.Drawing.Point(12, 77);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(175, 420);
- this.groupBox5.TabIndex = 5;
- this.groupBox5.TabStop = false;
- this.groupBox5.Text = "预览";
- //
- // dataGridView1
- //
- this.dataGridView1.AllowUserToAddRows = false;
- this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.ColumnHeadersVisible = false;
- this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column1});
- this.dataGridView1.Location = new System.Drawing.Point(7, 49);
- this.dataGridView1.MultiSelect = false;
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.RowHeadersVisible = false;
- this.dataGridView1.RowTemplate.Height = 23;
- this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView1.Size = new System.Drawing.Size(162, 364);
- this.dataGridView1.TabIndex = 5;
- this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
- //
- // Column1
- //
- this.Column1.HeaderText = "Column1";
- this.Column1.Name = "Column1";
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(138, 18);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(30, 25);
- this.button5.TabIndex = 3;
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(104, 18);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(30, 25);
- this.button4.TabIndex = 2;
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(70, 18);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(30, 25);
- this.button3.TabIndex = 1;
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // GridSettingDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(712, 512);
- this.Controls.Add(this.groupBox5);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "GridSettingDialog";
- this.Text = "网格设置";
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.Controls.SetChildIndex(this.groupBox4, 0);
- this.Controls.SetChildIndex(this.groupBox5, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- this.groupBox5.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- #region InitializeComponent2
- /// <summary>
- /// 初始化组件
- /// </summary>
- private void InitializeComponent2()
- {
- //this.textBox1.Text = gridModel.gridName;
- this.userTextBox1.Text = gridModel.grid.ActualLength.ToString();
- this.userTextBox2.Text = gridModel.grid.HorizontalNum.ToString();
- this.userTextBox3.Text = gridModel.grid.VerticalNum.ToString();
- this.comboBox1.SelectedIndex = gridModel.grid.DashStyle;
- this.comboBox2.SelectedIndex = gridModel.grid.Thickness - 1;
- this.gridPanel.BackColor = Color.FromArgb(gridModel.grid.Color);
- this.comboBox3.SelectedIndex = gridModel.rectangle.DashStyle;
- this.comboBox4.SelectedIndex = gridModel.rectangle.Thickness - 1;
- this.rectPanel.BackColor = Color.FromArgb(gridModel.rectangle.Color);
- this.comboBox5.SelectedIndex = gridModel.round.DashStyle;
- this.comboBox6.SelectedIndex = gridModel.round.Thickness - 1;
- this.circularPanel.BackColor = Color.FromArgb(gridModel.round.Color);
- this.colorsFormGrid = new ColorsForm();
- this.colorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
- this.colorsFormGrid.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsFormRect = new ColorsForm();
- this.colorsFormRect.StartPosition = FormStartPosition.CenterScreen;
- this.colorsFormRect.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsFormCircular = new ColorsForm();
- this.colorsFormCircular.StartPosition = FormStartPosition.CenterScreen;
- this.colorsFormCircular.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- //this.groupBox2.Enabled = false;
- //this.groupBox3.Enabled = false;
- //this.groupBox4.Enabled = false;
- }
- #endregion
- /// <summary>
- /// 给下拉集合赋值
- /// </summary>
- private void InitParameterData()
- {
- this.comboBox1.Items.AddRange(InvariantData.dashStyles);
- this.comboBox2.Items.AddRange(InvariantData.thinkness);
- this.comboBox3.Items.AddRange(InvariantData.dashStyles);
- this.comboBox4.Items.AddRange(InvariantData.thinkness);
- this.comboBox5.Items.AddRange(InvariantData.dashStyles);
- this.comboBox6.Items.AddRange(InvariantData.thinkness);
- }
- private void InitializeButtonBackgroudImage()
- {
- this.button3.FlatStyle = FlatStyle.Flat;
- this.button3.FlatAppearance.BorderSize = 0;
- this.button3.BackgroundImageLayout = ImageLayout.Center;
- this.button3.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListAddIcon.png").Reference;
- this.button4.FlatStyle = FlatStyle.Flat;
- this.button4.FlatAppearance.BorderSize = 0;
- this.button4.BackgroundImageLayout = ImageLayout.Center;
- this.button4.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListEditIcon.png").Reference;
- this.button5.FlatStyle = FlatStyle.Flat;
- this.button5.FlatAppearance.BorderSize = 0;
- this.button5.BackgroundImageLayout = ImageLayout.Center;
- this.button5.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListDeleteIcon.png").Reference;
- }
- /// <summary>
- /// 网格样式列表初始化
- /// </summary>
- private void InitializationDataGridView()
- {
- this.dataGridView1.Rows.Clear();
- //keyValuePairs.Clear();
- int serveNameID = 0;
- this.dataGridView1.ReadOnly = true;
- List<string> fileNames = FileOperationHelper.GetFileList(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\");
- if (fileNames.Count > 0)
- {
- for (int i = 0; i < fileNames.Count; i++)
- {
- GridModel gselectRidModel = XmlSerializeHelper.DESerializer<GridModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\" + fileNames[i], FileMode.Open));
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = gselectRidModel.gridName;
- if (gselectRidModel.gridName.Equals(Startup.instance.configModel.GridName))
- {
- serveNameID = i;
- }
- this.dataGridView1.Rows.Add(row);
- }
- if (operation != 2)
- {
- this.dataGridView1.CurrentCell = this.dataGridView1[0, serveNameID];
- }
- else
- {
- this.dataGridView1.CurrentCell = this.dataGridView1[0, 0];
- }
- RefreshDataGridView();
- }
- }
- /// <summary>
- /// 单位设置初始化
- /// </summary>
- private void UnitData()
- {
- //
- //获取系统标尺-微米
- //
- this.appWorkspace.getMeasureInfo().TryGetValue(MeasurementUnit.Micron, out unitLength);
- if (gridModel.grid.Unit == 6)
- {
- comboBox7.Text = "px";
- }
- else if (gridModel.grid.Unit == 4)
- {
- comboBox7.Text = "μm";
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
-
- if (this.userTextBox1.Text.Equals(""))
- {
- MessageBox.Show(PdnResources.GetString("Menu.eedgelengthofthegridcannotbeemptw.Text"));
- return;
- }
- if (this.userTextBox2.Text.Equals(""))
- {
- MessageBox.Show(PdnResources.GetString("Menu.henumberofhorizontalgridscanno.Text"));
- return;
- }
- if (this.userTextBox3.Text.Equals(""))
- {
- MessageBox.Show(PdnResources.GetString("Menu.henumberofverticalgridscannotbenu.Text"));
- return;
- }
- //临时model,根据应用场景运用
- GridModel temporarygridModel = new GridModel();
- temporarygridModel.grid = new GridModel.Grid();
- temporarygridModel.rectangle = new GridModel.Rectangle();
- temporarygridModel.round = new GridModel.Round();
- temporarygridModel.gridName = this.textBox1.Text;
-
- if ("px".Equals(comboBox7.Text))
- {
- temporarygridModel.grid.SideLength = int.Parse(this.userTextBox1.Text);
- }
- else if ("μm".Equals(comboBox7.Text))
- {
- temporarygridModel.grid.SideLength = int.Parse((double.Parse(this.userTextBox1.Text) / unitLength).ToString("F0"));
- }
- temporarygridModel.grid.HorizontalNum = int.Parse(this.userTextBox2.Text);
- temporarygridModel.grid.VerticalNum = int.Parse(this.userTextBox3.Text);
- temporarygridModel.grid.DashStyle = this.comboBox1.SelectedIndex;
- temporarygridModel.grid.Thickness = this.comboBox2.SelectedIndex + 1;
- temporarygridModel.grid.Color = this.gridPanel.BackColor.ToArgb();
- if ("px".Equals(comboBox7.Text))
- {
- temporarygridModel.grid.Unit = (int)MeasurementUnit.Pixel;
- }
- else if ("μm".Equals(comboBox7.Text))
- {
- temporarygridModel.grid.Unit = (int)MeasurementUnit.Micron;
- }
- temporarygridModel.rectangle.DashStyle = this.comboBox3.SelectedIndex;
- temporarygridModel.rectangle.Thickness = this.comboBox4.SelectedIndex + 1;
- temporarygridModel.rectangle.Color = this.rectPanel.BackColor.ToArgb();
- temporarygridModel.round.DashStyle = this.comboBox5.SelectedIndex;
- temporarygridModel.round.Thickness = this.comboBox6.SelectedIndex + 1;
- temporarygridModel.round.Color = this.circularPanel.BackColor.ToArgb();
- temporarygridModel.grid.ActualLength = int.Parse(this.userTextBox1.Text);
-
- //if (operation == 0)
- //{
- // gridModel.xmlName = "Grid" + (maxValue + 1).ToString();
- //}
- //if (operation == 1)
- //{
- // gridModel.xmlName = keyValuePairs[this.dataGridView1.CurrentCell.Value.ToString()];
- //}
- string userInfoXml = XmlSerializeHelper.XmlSerialize<GridModel>(temporarygridModel);
- //选中标尺保存到默认标尺(网格样式列表为空时用)
- if (operation == -1)
- {
- Startup.instance.gridModel = temporarygridModel;
- Startup.instance.configModel.GridName = this.textBox1.Text;
- string configXml = XmlSerializeHelper.XmlSerialize<ConfigModel>(Startup.instance.configModel);
- string configPath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Config.xml";
- FileOperationHelper.WriteStringToFile(configXml, configPath, FileMode.Create);
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Grid.xml";
- if (!FileOperationHelper.WriteStringToFile(userInfoXml, filePath, FileMode.Create))
- {
- MessageBox.Show(PdnResources.GetString("Menu.idinformationsavin.Text"));
- }
- if (appWorkspace.ActiveDocumentWorkspace != null)
- {
- appWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- }
-
- //添加
- if (operation == 0)
- {
- //保存到xml
- string gridFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\" + this.textBox1.Text + ".xml";
- if (System.IO.File.Exists(gridFilePath))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Thefilenandmodify.text"));
- return;
- }
- else
- {
- if (!FileOperationHelper.WriteStringToFile(userInfoXml, gridFilePath, FileMode.Create))
- {
- MessageBox.Show(PdnResources.GetString("Menu.idinformationsavin.Text"));
- }
- InitializationDataGridView();
- }
- this.button1.Text = PdnResources.GetString("Menu.application.text");
- }
- //修改
- if (operation == 1)
- {
- string updateName = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\" + this.dataGridView1.CurrentCell.Value + ".xml";
- System.IO.File.Delete(updateName);
- //FileOperationHelper.DeleteFolder(updateName);
- //保存到xml
- string gridFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\" + this.textBox1.Text + ".xml";
- if (System.IO.File.Exists(gridFilePath))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Thefilenandmodify.text"));
- return;
- }
- if (!FileOperationHelper.WriteStringToFile(userInfoXml, gridFilePath, FileMode.Create))
- {
- MessageBox.Show(PdnResources.GetString("Menu.idinformationsavin.Text"));
- }
- InitializationDataGridView();
- //this.dataGridView1.CurrentCell.Value = this.textBox1.Text;
- this.groupBox2.Enabled = false;
- this.groupBox3.Enabled = false;
- this.groupBox4.Enabled = false;
- this.button1.Text = PdnResources.GetString("Menu.application.text");
- }
- operation = -1;
- }
-
- /// <summary>
- /// 调色板回调函数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ce"></param>
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
-
- /// <summary>
- /// 网格Panel被点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void gridColorPanel_Click(object sender, EventArgs e)
- {
- this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.gridPanel.BackColor);
- this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
- this.colorsFormGrid.ShowDialog();
- }
- /// <summary>
- /// 网格Panel的调色板颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void gridColorChanged(object sender, EventArgs e)
- {
- this.gridPanel.BackColor = this.colorsFormGrid.UserPrimaryColor.ToColor();
- // this.measureStyleModel.backColor = this.colorsForm.UserPrimaryColor.ToColor().ToArgb();
- this.colorsFormGrid.Close();
- }
- /// <summary>
- /// 矩形Panel被点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void rectColorPanel_Click(object sender, EventArgs e)
- {
- this.colorsFormRect.UserPrimaryColor = ColorBgra.FromColor(this.rectPanel.BackColor);
- this.colorsFormRect.setSaveBtn_Click(new System.EventHandler(this.rectColorChanged));
- this.colorsFormRect.ShowDialog();
- }
- /// <summary>
- /// 矩形Panel的调色板颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void rectColorChanged(object sender, EventArgs e)
- {
- this.rectPanel.BackColor = this.colorsFormRect.UserPrimaryColor.ToColor();
- // this.measureStyleModel.backColor = this.colorsForm.UserPrimaryColor.ToColor().ToArgb();
- this.colorsFormRect.Close();
- }
- /// <summary>
- /// 圆形Panel被点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void circularColorPanel_Click(object sender, EventArgs e)
- {
- this.colorsFormCircular.UserPrimaryColor = ColorBgra.FromColor(this.circularPanel.BackColor);
- this.colorsFormCircular.setSaveBtn_Click(new System.EventHandler(this.circularColorChanged));
- this.colorsFormCircular.ShowDialog();
- }
- /// <summary>
- /// 圆形Panel的调色板颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void circularColorChanged(object sender, EventArgs e)
- {
- this.circularPanel.BackColor = this.colorsFormCircular.UserPrimaryColor.ToColor();
- // this.measureStyleModel.backColor = this.colorsForm.UserPrimaryColor.ToColor().ToArgb();
- this.colorsFormCircular.Close();
- }
- private string serveName = string.Empty;
- private void dataGridView1_SelectionChanged(object sender, EventArgs e)
- {
- RefreshDataGridView();
- }
- /// <summary>
- /// 刷新网格样式列表
- /// </summary>
- private void RefreshDataGridView()
- {
- if (this.dataGridView1.SelectedRows.Count > 0 && this.dataGridView1.CurrentCell != null)
- {
- serveName = this.dataGridView1.CurrentCell.Value.ToString();
- //string selectName = this.dataGridView1.CurrentCell.Value.ToString() + ".xml";
- GridModel gselectRidModel = XmlSerializeHelper.DESerializer<GridModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\" + serveName + ".xml", FileMode.Open));
- this.textBox1.Text = serveName;
- //网格
- this.userTextBox1.Text = gselectRidModel.grid.ActualLength.ToString();
- this.userTextBox2.Text = gselectRidModel.grid.HorizontalNum.ToString();
- this.userTextBox3.Text = gselectRidModel.grid.VerticalNum.ToString();
- this.comboBox1.SelectedIndex = gselectRidModel.grid.DashStyle;
- this.comboBox1.Text = gselectRidModel.grid.Thickness.ToString();
- this.gridPanel.BackColor = Color.FromArgb(gselectRidModel.grid.Color);
- //矩形
- this.comboBox3.SelectedIndex = gselectRidModel.rectangle.DashStyle;
- this.comboBox4.Text = gselectRidModel.rectangle.Thickness.ToString();
- this.rectPanel.BackColor = Color.FromArgb(gselectRidModel.rectangle.Color);
- //圆形
- this.comboBox5.SelectedIndex = gselectRidModel.round.DashStyle;
- this.comboBox6.Text = gselectRidModel.round.Thickness.ToString();
- this.circularPanel.BackColor = Color.FromArgb(gselectRidModel.round.Color);
- if (gselectRidModel.grid.Unit == 6)
- {
- comboBox7.Text = "px";
- }
- else if (gselectRidModel.grid.Unit == 4)
- {
- comboBox7.Text = "μm";
- }
- this.groupBox2.Enabled = false;
- this.groupBox3.Enabled = false;
- this.groupBox4.Enabled = false;
- }
- }
- //添加网格样式
- private void button3_Click(object sender, EventArgs e)
- {
- this.button1.Text = PdnResources.GetString("CloseWorkspaceAction.SaveButton.ActionText");
- this.textBox1.Text = "Grid";
- this.textBox1.Focus();
- //this.userTextBox2.Focus();
- //this.userTextBox3.Focus();
- this.dataGridView1.ClearSelection();
- operation = 0;
- this.groupBox2.Enabled = true;
- this.groupBox3.Enabled = true;
- this.groupBox4.Enabled = true;
- }
- //修改网格样式
- private void button4_Click(object sender, EventArgs e)
- {
- if (this.dataGridView1.Rows.Count > 0)
- {
- this.button1.Text = PdnResources.GetString("CloseWorkspaceAction.SaveButton.ActionText");
- this.textBox1.Focus();
- operation = 1;
- this.groupBox2.Enabled = true;
- this.groupBox3.Enabled = true;
- this.groupBox4.Enabled = true;
- }
-
- }
- //删除网格样式
- private void button5_Click(object sender, EventArgs e)
- {
- if (this.dataGridView1.Rows.Count > 1)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretcteddata.text") + "?", PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
- if (dr == DialogResult.OK)
- {
- operation = 2;
- string updateName = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\" + this.dataGridView1.CurrentCell.Value.ToString() + ".xml";
- System.IO.File.Delete(updateName);
- InitializationDataGridView();
- operation = -1;
- }
- }
- }
- /// <summary>
- /// 删除网格样式
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnDel_Click(object sender, EventArgs e)
- {
- if (this.dataGridView1.Rows.Count > 1)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretcteddata.text") + "?", PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
- if (dr == DialogResult.OK)
- {
- operation = 2;
- string updateName = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GridConfig\\" + this.dataGridView1.CurrentCell.Value.ToString() + ".xml";
- System.IO.File.Delete(updateName);
- InitializationDataGridView();
- operation = -1;
- }
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- }
- /// <summary>
- /// 另存为、新增
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSaveAs_Click(object sender, EventArgs e)
- {
- }
- }
- }
|