using PaintDotNet; using PaintDotNet.Annotation; using PaintDotNet.Annotation.Enum; using PaintDotNet.Annotation.Measure; using PaintDotNet.Base.CommTool; using PaintDotNet.Base.SettingModel; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Metis.Measuring { internal class MeasurementPropertiesDialog : Form { #region 控件 private GroupBox groupBox2; private Panel panel3; private ComboBox comboBox4; private Label label4; private ComboBox comboBox3; private Label label3; private Panel panel2; private ComboBox comboBox2; private Label label2; private NumericUpDown numericUpDown11; private ComboBox comboBox21; private NumericUpDown numericUpDown21; private Label label61; private Label label51; private Panel linePanel; private Label label41; private Panel textPanel; private Label label31; private Label label21; private ComboBox comboBox11; private Label label11; private GroupBox groupBox1; //private Button button2; private Button button3; private Button button1; PaintDotNet.ColorsForm colorsForm; PaintDotNet.ColorsForm colorsForm1; #endregion /// /// 主控件 /// private AppWorkspace appWorkspace; private DrawObject drawObject; /// /// 测量的样式 /// private MeasureStyleModel measureStyleModel = Startup.instance.measureStyleModel; /// /// 主配置文件的model /// private ConfigModel configModel = Startup.instance.configModel; private NumericUpDown numericUpDown1; private Label label5; private ComboBox comboBox5; private Label label6; private ComboBox comboBox91; private System.Windows.Forms.Label label91; /// /// 字体列表 /// ArrayList fontsItems = new ArrayList(); public MeasurementPropertiesDialog(AppWorkspace appWorkspace, DrawObject drawObject) { this.appWorkspace = appWorkspace; this.drawObject = drawObject; InitializeComponent(); this.comboBox3.Items.AddRange(new object[] { PdnResources.GetString("Menu.Upperleft.text"), PdnResources.GetString("Menu.Uppermiddle.Text"), PdnResources.GetString("Menu.Upperright.text"), PdnResources.GetString("Menu.Lowerleft.text"), PdnResources.GetString("Menu.Themiddleandlower.Text"), PdnResources.GetString("Menu.Lowerright.text")}); this.comboBox91.Items.AddRange(new object[] { "度", "密位"}); this.comboBox4.Items.AddRange(new object[] { PdnResources.GetString("Menu.Upperleft.text"), PdnResources.GetString("Menu.Uppermiddle.Text"), PdnResources.GetString("Menu.Upperright.text"), PdnResources.GetString("Menu.Lowerleft.text"), PdnResources.GetString("Menu.Themiddleandlower.Text"), PdnResources.GetString("Menu.Lowerright.text")}); this.Text = PdnResources.GetString("Menu.MeasureAction." + drawObject.drawToolType.ToString() + ".Text") + "属性设置"; //绑定线样式数据 this.comboBox21.Items.AddRange(InvariantData.dashStyles); this.colorsForm = new ColorsForm(); this.colorsForm.StartPosition = FormStartPosition.CenterScreen; this.colorsForm.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged); this.colorsForm1 = new ColorsForm(); this.colorsForm1.StartPosition = FormStartPosition.CenterScreen; this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged); this.fontsItems.Clear(); //绑定字体数据 System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection(); foreach (FontFamily fontFamily in fonts.Families) { fontsItems.Add(fontFamily.Name); } this.comboBox11.DataSource = fontsItems; UpdateRightSettingUI(); } #region 初始化 private void InitializeComponent() { this.comboBox91 = new System.Windows.Forms.ComboBox(); this.label91 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.comboBox5 = new System.Windows.Forms.ComboBox(); this.label6 = new System.Windows.Forms.Label(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.label5 = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); this.comboBox4 = new System.Windows.Forms.ComboBox(); this.label4 = new System.Windows.Forms.Label(); this.comboBox3 = new System.Windows.Forms.ComboBox(); this.label3 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label2 = new System.Windows.Forms.Label(); this.numericUpDown11 = new System.Windows.Forms.NumericUpDown(); this.comboBox21 = new System.Windows.Forms.ComboBox(); this.numericUpDown21 = new System.Windows.Forms.NumericUpDown(); this.label61 = new System.Windows.Forms.Label(); this.label51 = new System.Windows.Forms.Label(); this.linePanel = new System.Windows.Forms.Panel(); this.label41 = new System.Windows.Forms.Label(); this.textPanel = new System.Windows.Forms.Panel(); this.label31 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label(); this.comboBox11 = new System.Windows.Forms.ComboBox(); this.label11 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button3 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.panel3.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).BeginInit(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // groupBox2 // this.groupBox2.Controls.Add(this.comboBox5); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Controls.Add(this.numericUpDown1); this.groupBox2.Controls.Add(this.label5); this.groupBox2.Controls.Add(this.panel3); this.groupBox2.Controls.Add(this.panel2); this.groupBox2.Controls.Add(this.numericUpDown11); this.groupBox2.Controls.Add(this.comboBox21); this.groupBox2.Controls.Add(this.numericUpDown21); this.groupBox2.Controls.Add(this.label61); this.groupBox2.Controls.Add(this.label51); this.groupBox2.Controls.Add(this.linePanel); this.groupBox2.Controls.Add(this.label41); this.groupBox2.Controls.Add(this.textPanel); this.groupBox2.Controls.Add(this.label31); this.groupBox2.Controls.Add(this.label21); this.groupBox2.Controls.Add(this.comboBox11); this.groupBox2.Controls.Add(this.label11); this.groupBox2.Controls.Add(this.comboBox91); this.groupBox2.Controls.Add(this.label91); this.groupBox2.Location = new System.Drawing.Point(10, 76); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(633, 235); this.groupBox2.TabIndex = 8; this.groupBox2.TabStop = false; this.groupBox2.Text = "设置"; // // labe91 // this.label91.AutoSize = true; this.label91.Location = new System.Drawing.Point(14, 182); this.label91.Name = "labe91"; this.label91.Size = new System.Drawing.Size(89, 12); this.label91.TabIndex = 14; this.label91.Text = "角度单位:"; // // comboBox91 // this.comboBox91.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox91.FormattingEnabled = true; this.comboBox91.Location = new System.Drawing.Point(91, 179); this.comboBox91.Name = "comboBox91"; this.comboBox91.Size = new System.Drawing.Size(152, 20); this.comboBox91.TabIndex = 15; // // comboBox5 // this.comboBox5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox5.FormattingEnabled = true; this.comboBox5.Items.AddRange(new object[] { "随线", "水平"}); this.comboBox5.Location = new System.Drawing.Point(337, 46); this.comboBox5.Name = "comboBox5"; this.comboBox5.Size = new System.Drawing.Size(122, 20); this.comboBox5.TabIndex = 22; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(260, 50); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(65, 12); this.label6.TabIndex = 21; this.label6.Text = "文字方向:"; // // numericUpDown1 // this.numericUpDown1.Location = new System.Drawing.Point(337, 21); this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Size = new System.Drawing.Size(152, 21); this.numericUpDown1.TabIndex = 20; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(260, 25); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(65, 12); this.label5.TabIndex = 19; this.label5.Text = "垂线长度:"; // // panel3 // this.panel3.Controls.Add(this.comboBox4); this.panel3.Controls.Add(this.label4); this.panel3.Controls.Add(this.comboBox3); this.panel3.Controls.Add(this.label3); this.panel3.Location = new System.Drawing.Point(9, 175); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(236, 57); this.panel3.TabIndex = 16; // // comboBox4 // this.comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox4.FormattingEnabled = true; this.comboBox4.Location = new System.Drawing.Point(112, 30); this.comboBox4.Name = "comboBox4"; this.comboBox4.Size = new System.Drawing.Size(122, 20); this.comboBox4.TabIndex = 17; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(5, 34); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(89, 12); this.label4.TabIndex = 16; this.label4.Text = "文字位置(点):"; // // comboBox3 // this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox3.FormattingEnabled = true; this.comboBox3.Location = new System.Drawing.Point(112, 4); this.comboBox3.Name = "comboBox3"; this.comboBox3.Size = new System.Drawing.Size(122, 20); this.comboBox3.TabIndex = 15; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(5, 7); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(89, 12); this.label3.TabIndex = 14; this.label3.Text = "文字位置(线):"; // // panel2 // this.panel2.Controls.Add(this.comboBox2); this.panel2.Controls.Add(this.label2); this.panel2.Location = new System.Drawing.Point(9, 175); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(236, 57); this.panel2.TabIndex = 15; // // comboBox2 // this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox2.FormattingEnabled = true; this.comboBox2.Location = new System.Drawing.Point(82, 3); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(152, 20); this.comboBox2.TabIndex = 15; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(5, 7); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(0, 12); this.label2.TabIndex = 14; this.label2.Text = "文字位置:"; // // numericUpDown11 // this.numericUpDown11.Location = new System.Drawing.Point(91, 125); this.numericUpDown11.Name = "numericUpDown11"; this.numericUpDown11.Size = new System.Drawing.Size(152, 21); this.numericUpDown11.TabIndex = 14; // // comboBox21 // this.comboBox21.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox21.FormattingEnabled = true; this.comboBox21.Location = new System.Drawing.Point(91, 151); this.comboBox21.Name = "comboBox21"; this.comboBox21.Size = new System.Drawing.Size(152, 20); this.comboBox21.TabIndex = 13; // // numericUpDown21 // this.numericUpDown21.Location = new System.Drawing.Point(91, 46); this.numericUpDown21.Name = "numericUpDown21"; this.numericUpDown21.Size = new System.Drawing.Size(152, 21); this.numericUpDown21.TabIndex = 12; // // label61 // this.label61.AutoSize = true; this.label61.Location = new System.Drawing.Point(13, 155); this.label61.Name = "label61"; this.label61.Size = new System.Drawing.Size(65, 12); this.label61.TabIndex = 9; this.label61.Text = "线条样式:"; // // label51 // this.label51.AutoSize = true; this.label51.Location = new System.Drawing.Point(13, 128); this.label51.Name = "label51"; this.label51.Size = new System.Drawing.Size(65, 12); this.label51.TabIndex = 8; this.label51.Text = "线条宽度:"; // // linePanel // this.linePanel.BackColor = System.Drawing.SystemColors.Window; this.linePanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.linePanel.Location = new System.Drawing.Point(91, 99); this.linePanel.Name = "linePanel"; this.linePanel.Size = new System.Drawing.Size(152, 20); this.linePanel.TabIndex = 7; this.linePanel.Click += new System.EventHandler(this.lineColorPanel_Click); // // label41 // this.label41.AutoSize = true; this.label41.Location = new System.Drawing.Point(13, 99); this.label41.Name = "label41"; this.label41.Size = new System.Drawing.Size(65, 12); this.label41.TabIndex = 6; this.label41.Text = "线条颜色:"; // // textPanel // this.textPanel.BackColor = System.Drawing.SystemColors.Window; this.textPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.textPanel.Location = new System.Drawing.Point(91, 73); this.textPanel.Name = "textPanel"; this.textPanel.Size = new System.Drawing.Size(152, 20); this.textPanel.TabIndex = 5; this.textPanel.Click += new System.EventHandler(this.textColorPanel_Click); // // label31 // this.label31.AutoSize = true; this.label31.Location = new System.Drawing.Point(13, 76); this.label31.Name = "label31"; this.label31.Size = new System.Drawing.Size(65, 12); this.label31.TabIndex = 4; this.label31.Text = "文字颜色:"; // // label21 // this.label21.AutoSize = true; this.label21.Location = new System.Drawing.Point(13, 50); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(65, 12); this.label21.TabIndex = 2; this.label21.Text = "文字字号:"; // // comboBox11 // this.comboBox11.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox11.FormattingEnabled = true; this.comboBox11.Location = new System.Drawing.Point(91, 20); this.comboBox11.Name = "comboBox11"; this.comboBox11.Size = new System.Drawing.Size(152, 20); this.comboBox11.TabIndex = 1; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(13, 23); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(65, 12); this.label11.TabIndex = 0; this.label11.Text = "文字字体:"; // // groupBox1 // this.groupBox1.Controls.Add(this.button3); 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(633, 58); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; this.groupBox1.Text = "操作"; // // button3 // this.button3.Location = new System.Drawing.Point(541, 20); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 23); this.button3.TabIndex = 2; this.button3.Text = "关闭"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // button1 // this.button1.Location = new System.Drawing.Point(460, 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); // // MeasurementPropertiesDialog // this.ClientSize = new System.Drawing.Size(652, 319); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "MeasurementPropertiesDialog"; this.Text = "测量属性"; this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).EndInit(); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); } #endregion private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce) { } private void textColorPanel_Click(object sender, EventArgs e) { this.colorsForm.UserPrimaryColor = ColorBgra.FromColor(this.textPanel.BackColor); this.colorsForm.setSaveBtn_Click(new System.EventHandler(this.textColorChanged)); this.colorsForm.ShowDialog(); } private void textColorChanged(object sender, EventArgs e) { this.textPanel.BackColor = this.colorsForm.UserPrimaryColor.ToColor(); //this.measureStyleModel.backColor = this.colorsForm.UserPrimaryColor.ToColor().ToArgb(); this.colorsForm.Close(); } private void lineColorPanel_Click(object sender, EventArgs e) { this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.linePanel.BackColor); this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.lineColorChanged)); this.colorsForm1.ShowDialog(); } private void lineColorChanged(object sender, EventArgs e) { this.linePanel.BackColor = this.colorsForm1.UserPrimaryColor.ToColor(); // this.measureStyleModel.backColor = this.colorsForm.UserPrimaryColor.ToColor().ToArgb(); this.colorsForm1.Close(); } /// /// 初始化属性画面 /// private void UpdateRightSettingUI() { switch (this.drawObject.drawToolType) { case DrawToolType.MeasureLine: //长度测量直线 MeasureStyleModel.MeasureLine measureLine = this.measureStyleModel.measureLine; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = true; this.label5.Visible = true; this.comboBox5.Visible = true; this.label6.Visible = true; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(false); this.UpdateMeasureStyleData(measureLine.font, measureLine.fontSize, measureLine.textColor, measureLine.lineColor, measureLine.lineWidth, measureLine.lineStyle, measureLine.linePosition, 0, 0, measureLine.vLineLength,measureLine.followLine); break; case DrawToolType.MeasureDistanceLine: //长度测量距离 MeasureStyleModel.MeasureDistanceLine measureDistanceLine = this.measureStyleModel.measureDistanceLine; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(false); this.UpdateMeasureStyleData(measureDistanceLine.font, measureDistanceLine.fontSize, measureDistanceLine.textColor, measureDistanceLine.lineColor, measureDistanceLine.lineWidth, measureDistanceLine.lineStyle, measureDistanceLine.linePosition, 0, 0, -1); break; case DrawToolType.MeasureLength: //长度测量->长度 MeasureStyleModel.MeasureLength measureLength = this.measureStyleModel.measureLength; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(false); this.UpdateMeasureStyleData(measureLength.font, measureLength.fontSize, measureLength.textColor, measureLength.lineColor, measureLength.lineWidth, measureLength.lineStyle, measureLength.linePosition, 0, 0, -1); break; case DrawToolType.MeasureHLine: //长度测量->水平线 MeasureStyleModel.MeasureHLine measureHLine = this.measureStyleModel.measureHLine; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = true; this.label5.Visible = true; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(false); this.UpdateMeasureStyleData(measureHLine.font, measureHLine.fontSize, measureHLine.textColor, measureHLine.lineColor, measureHLine.lineWidth, measureHLine.lineStyle, measureHLine.linePosition, 0, 0, measureHLine.vLineLength); break; case DrawToolType.MeasureVLine: //长度测量->垂线 MeasureStyleModel.MeasureVLine measureVLine = this.measureStyleModel.measureVLine; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = true; this.label5.Visible = true; this.comboBox5.Visible = true; this.label6.Visible = true; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(false); this.UpdateMeasureStyleData(measureVLine.font, measureVLine.fontSize, measureVLine.textColor, measureVLine.lineColor, measureVLine.lineWidth, measureVLine.lineStyle, measureVLine.linePosition, 0, 0, measureVLine.vLineLength, measureVLine.followLine); break; case DrawToolType.MeasureMulLine: //多点线段->多点直线 MeasureStyleModel.MeasureMulLine measureMulLine = this.measureStyleModel.measureMulLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = true; this.label5.Visible = true; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureMulLine.font, measureMulLine.fontSize, measureMulLine.textColor, measureMulLine.lineColor, measureMulLine.lineWidth, measureMulLine.lineStyle, 0, measureMulLine.linePositionL, measureMulLine.linePositionP, measureMulLine.vLineLength); break; case DrawToolType.MeasureMulHVLine: //多点线段->多点水平线 MeasureStyleModel.MeasureMulHVLine measureMulHVLine = this.measureStyleModel.measureMulHVLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = true; this.label5.Visible = true; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureMulHVLine.font, measureMulHVLine.fontSize, measureMulHVLine.textColor, measureMulHVLine.lineColor, measureMulHVLine.lineWidth, measureMulHVLine.lineStyle, 0, measureMulHVLine.linePositionL, measureMulHVLine.linePositionP, measureMulHVLine.vLineLength); break; case DrawToolType.MeasureMulSegment: //多点线段->多点线段 MeasureStyleModel.MeasureMulSegment measureMulSegment = this.measureStyleModel.measureMulSegment; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = true; this.label5.Visible = true; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureMulSegment.font, measureMulSegment.fontSize, measureMulSegment.textColor, measureMulSegment.lineColor, measureMulSegment.lineWidth, measureMulSegment.lineStyle, 0, measureMulSegment.linePositionL, measureMulSegment.linePositionP, measureMulSegment.vLineLength); break; case DrawToolType.MeasureMulVLine: //多点线段->多点垂直线 MeasureStyleModel.MeasureMulVLine measureMulVLine = this.measureStyleModel.measureMulVLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = true; this.label5.Visible = true; this.comboBox5.Visible = true; this.label6.Visible = true; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureMulVLine.font, measureMulVLine.fontSize, measureMulVLine.textColor, measureMulVLine.lineColor, measureMulVLine.lineWidth, measureMulVLine.lineStyle, 0, measureMulVLine.linePositionL, measureMulVLine.linePositionP, measureMulVLine.vLineLength, measureMulVLine.followLine); break; case DrawToolType.MeasureBrokenLine: //曲线长度->折线 MeasureStyleModel.MeasureBrokenLine measureBrokenLine = this.measureStyleModel.measureBrokenLine; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(true); this.UpdateMeasureStyleData(measureBrokenLine.font, measureBrokenLine.fontSize, measureBrokenLine.textColor, measureBrokenLine.lineColor, measureBrokenLine.lineWidth, measureBrokenLine.lineStyle, measureBrokenLine.linePosition, 0, 0, -1); break; case DrawToolType.MeasureTraceCurve: //曲线长度->轨迹曲线 MeasureStyleModel.MeasureTraceCurve measureTraceCurve = this.measureStyleModel.measureTraceCurve; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(true); this.UpdateMeasureStyleData(measureTraceCurve.font, measureTraceCurve.fontSize, measureTraceCurve.textColor, measureTraceCurve.lineColor, measureTraceCurve.lineWidth, measureTraceCurve.lineStyle, measureTraceCurve.linePosition, 0, 0, -1); break; case DrawToolType.MeasureCurveLine: //曲线长度->曲线 MeasureStyleModel.MeasureCurveLine measureCurveLine = this.measureStyleModel.measureCurveLine; this.panel2.Visible = true; this.panel3.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(true); this.UpdateMeasureStyleData(measureCurveLine.font, measureCurveLine.fontSize, measureCurveLine.textColor, measureCurveLine.lineColor, measureCurveLine.lineWidth, measureCurveLine.lineStyle, measureCurveLine.linePosition, 0, 0, -1); break; case DrawToolType.MeasurePLine: //点垂线->点垂线 MeasureStyleModel.MeasurePLine measurePLine = this.measureStyleModel.measurePLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measurePLine.font, measurePLine.fontSize, measurePLine.textColor, measurePLine.lineColor, measurePLine.lineWidth, measurePLine.lineStyle, 0, measurePLine.linePositionL, measurePLine.linePositionP, -1); break; case DrawToolType.MeasureMulPLine: //点垂线->多点垂线 MeasureStyleModel.MeasureMulPLine measureMulPLine = this.measureStyleModel.measureMulPLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureMulPLine.font, measureMulPLine.fontSize, measureMulPLine.textColor, measureMulPLine.lineColor, measureMulPLine.lineWidth, measureMulPLine.lineStyle, 0, measureMulPLine.linePositionL, measureMulPLine.linePositionP, -1); break; case DrawToolType.MeasureHMulPLine: //点垂线->水平多点垂线 MeasureStyleModel.MeasureHMulPLine measureHMulPLine = this.measureStyleModel.measureHMulPLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureHMulPLine.font, measureHMulPLine.fontSize, measureHMulPLine.textColor, measureHMulPLine.lineColor, measureHMulPLine.lineWidth, measureHMulPLine.lineStyle, 0, measureHMulPLine.linePositionL, measureHMulPLine.linePositionP, -1); break; case DrawToolType.MeasureVMulPLine: //点垂线->垂直多点垂线 MeasureStyleModel.MeasureVMulPLine measureVMulPLine = this.measureStyleModel.measureVMulPLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureVMulPLine.font, measureVMulPLine.fontSize, measureVMulPLine.textColor, measureVMulPLine.lineColor, measureVMulPLine.lineWidth, measureVMulPLine.lineStyle, 0, measureVMulPLine.linePositionL, measureVMulPLine.linePositionP, -1); break; case DrawToolType.MeasurePointHLine: //点垂线->点到水平线距离 MeasureStyleModel.MeasurePointHLine measurePointHLine = this.measureStyleModel.measurePointHLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measurePointHLine.font, measurePointHLine.fontSize, measurePointHLine.textColor, measurePointHLine.lineColor, measurePointHLine.lineWidth, measurePointHLine.lineStyle, 0, measurePointHLine.linePositionL, measurePointHLine.linePositionP, -1); break; case DrawToolType.MeasureParallelLine: //平行线测量->平行线 MeasureStyleModel.MeasureParallelLine measureParallelLine = this.measureStyleModel.measureParallelLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = true; this.label6.Visible = true; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureParallelLine.font, measureParallelLine.fontSize, measureParallelLine.textColor, measureParallelLine.lineColor, measureParallelLine.lineWidth, measureParallelLine.lineStyle, 0, measureParallelLine.linePositionL, measureParallelLine.linePositionP, -1, measureParallelLine.followLine); break; case DrawToolType.MeasureMulParallelLine: //平行线测量->多点平行线 MeasureStyleModel.MeasureMulParallelLine measureMulParallelLine = this.measureStyleModel.measureMulParallelLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureMulParallelLine.font, measureMulParallelLine.fontSize, measureMulParallelLine.textColor, measureMulParallelLine.lineColor, measureMulParallelLine.lineWidth, measureMulParallelLine.lineStyle, 0, measureMulParallelLine.linePositionL, measureMulParallelLine.linePositionP, -1); break; case DrawToolType.MeasureVMulParallelLine: //平行线测量->垂直多点平行线 MeasureStyleModel.MeasureVMulParallelLine measureVMulParallelLine = this.measureStyleModel.measureVMulParallelLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureVMulParallelLine.font, measureVMulParallelLine.fontSize, measureVMulParallelLine.textColor, measureVMulParallelLine.lineColor, measureVMulParallelLine.lineWidth, measureVMulParallelLine.lineStyle, 0, measureVMulParallelLine.linePositionL, measureVMulParallelLine.linePositionP, -1); break; case DrawToolType.MeasureHMulParallelLine: //平行线测量->水平多点平行线 MeasureStyleModel.MeasureHMulParallelLine measureHMulParallelLine = this.measureStyleModel.measureHMulParallelLine; this.panel3.Visible = true; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureHMulParallelLine.font, measureHMulParallelLine.fontSize, measureHMulParallelLine.textColor, measureHMulParallelLine.lineColor, measureHMulParallelLine.lineWidth, measureHMulParallelLine.lineStyle, 0, measureHMulParallelLine.linePositionL, measureHMulParallelLine.linePositionP, -1); break; case DrawToolType.MeasureClosedCurve: //多边形测量->闭合曲线 MeasureStyleModel.MeasureClosedCurve measureClosedCurve = this.measureStyleModel.measureClosedCurve; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureClosedCurve.font, measureClosedCurve.fontSize, measureClosedCurve.textColor, measureClosedCurve.lineColor, measureClosedCurve.lineWidth, measureClosedCurve.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasurePolygon: //多边形测量->多边形 MeasureStyleModel.MeasurePolygon measurePolygon = this.measureStyleModel.measurePolygon; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measurePolygon.font, measurePolygon.fontSize, measurePolygon.textColor, measurePolygon.lineColor, measurePolygon.lineWidth, measurePolygon.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureRectangle: //多边形测量->矩形 MeasureStyleModel.MeasureRectangle measureRectangle = this.measureStyleModel.measureRectangle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureRectangle.font, measureRectangle.fontSize, measureRectangle.textColor, measureRectangle.lineColor, measureRectangle.lineWidth, measureRectangle.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureRandRectangle: //多边形测量->任意矩形 MeasureStyleModel.MeasureRandRectangle measureRandRectangle = this.measureStyleModel.measureRandRectangle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureRandRectangle.font, measureRandRectangle.fontSize, measureRandRectangle.textColor, measureRandRectangle.lineColor, measureRandRectangle.lineWidth, measureRandRectangle.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureSquare: //多边形测量->正方形 MeasureStyleModel.MeasureSquare measureSquare = this.measureStyleModel.measureSquare; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureSquare.font, measureSquare.fontSize, measureSquare.textColor, measureSquare.lineColor, measureSquare.lineWidth, measureSquare.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureRandSquare: //多边形测量->任意正方形 MeasureStyleModel.MeasureRandSquare measureRandSquare = this.measureStyleModel.measureRandSquare; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureRandSquare.font, measureRandSquare.fontSize, measureRandSquare.textColor, measureRandSquare.lineColor, measureRandSquare.lineWidth, measureRandSquare.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureTracePolygon: //多边形测量->轨迹多边形 MeasureStyleModel.MeasureTracePolygon measureTracePolygon = this.measureStyleModel.measureTracePolygon; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureTracePolygon.font, measureTracePolygon.fontSize, measureTracePolygon.textColor, measureTracePolygon.lineColor, measureTracePolygon.lineWidth, measureTracePolygon.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureCircle: //圆形测量->三点圆 MeasureStyleModel.MeasureCircle measureCircle = this.measureStyleModel.measureCircle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureCircle.font, measureCircle.fontSize, measureCircle.textColor, measureCircle.lineColor, measureCircle.lineWidth, measureCircle.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureInnerCircle: //圆形测量->向内画圆 MeasureStyleModel.MeasureInnerCircle measureInnerCircle = this.measureStyleModel.measureInnerCircle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureInnerCircle.font, measureInnerCircle.fontSize, measureInnerCircle.textColor, measureInnerCircle.lineColor, measureInnerCircle.lineWidth, measureInnerCircle.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureOuterCircle: //圆形测量->向外画圆 MeasureStyleModel.MeasureOuterCircle measureOuterCircle = this.measureStyleModel.measureOuterCircle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureOuterCircle.font, measureOuterCircle.fontSize, measureOuterCircle.textColor, measureOuterCircle.lineColor, measureOuterCircle.lineWidth, measureOuterCircle.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureDiameterCircle: //圆形测量->直径画圆 MeasureStyleModel.MeasureDiameterCircle measureDiameterCircle = this.measureStyleModel.measureDiameterCircle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measureDiameterCircle.font, measureDiameterCircle.fontSize, measureDiameterCircle.textColor, measureDiameterCircle.lineColor, measureDiameterCircle.lineWidth, measureDiameterCircle.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasurePointEdgeSize: //圆形测量->点到圆距离 MeasureStyleModel.MeasurePointEdgeSize measurePointEdgeSize = this.measureStyleModel.measurePointEdgeSize; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measurePointEdgeSize.font, measurePointEdgeSize.fontSize, measurePointEdgeSize.textColor, measurePointEdgeSize.lineColor, measurePointEdgeSize.lineWidth, measurePointEdgeSize.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasurePointCenterSize: //圆形测量->点到圆心距离 MeasureStyleModel.MeasurePointCenterSize measurePointCenterSize = this.measureStyleModel.measurePointCenterSize; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measurePointCenterSize.font, measurePointCenterSize.fontSize, measurePointCenterSize.textColor, measurePointCenterSize.lineColor, measurePointCenterSize.lineWidth, measurePointCenterSize.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasurePointArcSize: //圆形测量->点到圆弧距离 MeasureStyleModel.MeasurePointArcSize measurePointArcSize = this.measureStyleModel.measurePointArcSize; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; this.UpdateMeasureStyleData(measurePointArcSize.font, measurePointArcSize.fontSize, measurePointArcSize.textColor, measurePointArcSize.lineColor, measurePointArcSize.lineWidth, measurePointArcSize.lineStyle, 0, 0, 0, -1); break; case DrawToolType.MeasureThreePointAngle: //角度测量->三点角度 MeasureStyleModel.MeasureThreePointAngle measureThreePointAngle = this.measureStyleModel.measureThreePointAngle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = true; this.comboBox91.Visible = true; this.UpdateMeasureStyleData(measureThreePointAngle.font, measureThreePointAngle.fontSize, measureThreePointAngle.textColor, measureThreePointAngle.lineColor, measureThreePointAngle.lineWidth, measureThreePointAngle.lineStyle, 0, 0, 0, -1,false, measureThreePointAngle.isAngle); break; case DrawToolType.MeasureFourPointAngle: //角度测量->四点角度 MeasureStyleModel.MeasureFourPointAngle measureFourPointAngle = this.measureStyleModel.measureFourPointAngle; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = true; this.comboBox91.Visible = true; this.UpdateMeasureStyleData(measureFourPointAngle.font, measureFourPointAngle.fontSize, measureFourPointAngle.textColor, measureFourPointAngle.lineColor, measureFourPointAngle.lineWidth, measureFourPointAngle.lineStyle, 0, 0, 0, -1, false, measureFourPointAngle.isAngle); break; case DrawToolType.MeasureThreePointArc: //角度测量->三点弧 MeasureStyleModel.MeasureThreePointArc measureThreePointArc = this.measureStyleModel.measureThreePointArc; this.panel3.Visible = false; this.panel2.Visible = false; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = true; this.comboBox91.Visible = true; this.UpdateMeasureStyleData(measureThreePointArc.font, measureThreePointArc.fontSize, measureThreePointArc.textColor, measureThreePointArc.lineColor, measureThreePointArc.lineWidth, measureThreePointArc.lineStyle, 0, 0, 0, -1, false, measureThreePointArc.isAngle); break; case DrawToolType.MeasureCenterCenterSize: //对准度测量->圆心到圆心距离 MeasureStyleModel.MeasureCenterCenterSize measureCenterCenterSize = this.measureStyleModel.measureCenterCenterSize; this.panel3.Visible = false; this.panel2.Visible = true; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(false); this.UpdateMeasureStyleData(measureCenterCenterSize.font, measureCenterCenterSize.fontSize, measureCenterCenterSize.textColor, measureCenterCenterSize.lineColor, measureCenterCenterSize.lineWidth, measureCenterCenterSize.lineStyle, measureCenterCenterSize.linePosition, 0, 0, -1); break; case DrawToolType.MeasureTwoLineVLDistance: //对准度测量->两线中垂线距离 MeasureStyleModel.MeasureTwoLineVLDistance measureTwoLineVLDistance = this.measureStyleModel.measureTwoLineVLDistance; this.panel3.Visible = false; this.panel2.Visible = true; this.numericUpDown1.Visible = false; this.label5.Visible = false; this.comboBox5.Visible = false; this.label6.Visible = false; this.label91.Visible = false; this.comboBox91.Visible = false; UpdataFontPosition(false); this.UpdateMeasureStyleData(measureTwoLineVLDistance.font, measureTwoLineVLDistance.fontSize, measureTwoLineVLDistance.textColor, measureTwoLineVLDistance.lineColor, measureTwoLineVLDistance.lineWidth, measureTwoLineVLDistance.lineStyle, measureTwoLineVLDistance.linePosition, 0, 0, -1); break; } } private void UpdataFontPosition(bool curve) { List position = new List { PdnResources.GetString("Menu.Upperleft.text") , PdnResources.GetString("Menu.Uppermiddle.Text") , PdnResources.GetString("Menu.Upperright.text") , PdnResources.GetString("Menu.Lowerleft.text") , PdnResources.GetString("Menu.Themiddleandlower.Text") , PdnResources.GetString("Menu.Lowerright.text")}; List position1 = new List { PdnResources.GetString("Menu.hestartingpoint.Text") , PdnResources.GetString("Menu.Theendpoint.Text") }; this.comboBox2.DataSource = null; if (curve) this.comboBox2.DataSource = position1; else this.comboBox2.DataSource = position; } /// /// 更新显示区域控件的数值 /// /// /// /// /// /// /// private void UpdateMeasureStyleData(string font, int fontSize, int textColor, int lineColor, int lineWidth, int lineStyle, int linePosition, int linePositionL, int linePositionP, int vLineLength, bool followLine = false, bool isAngle = false) { //绑定样式默认数据 this.comboBox11.Text = font; this.numericUpDown21.Value = fontSize; this.textPanel.BackColor = Color.FromArgb(textColor); this.linePanel.BackColor = Color.FromArgb(lineColor); this.numericUpDown11.Value = lineWidth; this.comboBox21.SelectedIndex = lineStyle; if (this.comboBox2.Items.Count > 0) this.comboBox2.SelectedIndex = linePosition; if (this.comboBox3.Items.Count > 0) this.comboBox3.SelectedIndex = linePositionL; if (this.comboBox4.Items.Count > 0) this.comboBox4.SelectedIndex = linePositionP; if(vLineLength > -1) this.numericUpDown1.Value = vLineLength; if (followLine) { this.comboBox5.SelectedIndex = 0; } else { this.comboBox5.SelectedIndex = 1; } this.comboBox91.SelectedIndex = isAngle ? 1 : 0; } /// /// 保存 /// private void button2_Click() { //调用检查类型 this.checkSaveModel(); //以下保存xml文件信息 string stageModelXml = XmlSerializeHelper.XmlSerialize(this.measureStyleModel); string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + "Default" + ".xml"; FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create); } /// /// 检查保存类型 /// private void checkSaveModel() { string font = comboBox11.Text; int fontSize = Convert.ToInt32(numericUpDown21.Value); int textColor = Convert.ToInt32(this.textPanel.BackColor.ToArgb()); int lineColor = Convert.ToInt32(this.linePanel.BackColor.ToArgb()); int lineWidth = Convert.ToInt32(numericUpDown11.Value); int lineStyle = this.comboBox21.SelectedIndex; int linePosition = this.comboBox2.SelectedIndex; int linePositionL = this.comboBox3.SelectedIndex; int linePositionP = this.comboBox4.SelectedIndex; int vLineLength = Convert.ToInt32(this.numericUpDown1.Value); bool isAngle = comboBox91.SelectedIndex == 0 ? false : true; switch (this.drawObject.drawToolType) { case DrawToolType.MeasureLine: //长度测量直线 this.measureStyleModel.measureLine.font = font; this.measureStyleModel.measureLine.fontSize = fontSize; this.measureStyleModel.measureLine.textColor = textColor; this.measureStyleModel.measureLine.lineColor = lineColor; this.measureStyleModel.measureLine.lineWidth = lineWidth; this.measureStyleModel.measureLine.lineStyle = lineStyle; this.measureStyleModel.measureLine.linePosition = linePosition; this.measureStyleModel.measureLine.vLineLength = vLineLength; this.measureStyleModel.measureLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false; break; case DrawToolType.MeasureDistanceLine: //长度测量距离 this.measureStyleModel.measureDistanceLine.font = font; this.measureStyleModel.measureDistanceLine.fontSize = fontSize; this.measureStyleModel.measureDistanceLine.textColor = textColor; this.measureStyleModel.measureDistanceLine.lineColor = lineColor; this.measureStyleModel.measureDistanceLine.lineWidth = lineWidth; this.measureStyleModel.measureDistanceLine.lineStyle = lineStyle; this.measureStyleModel.measureDistanceLine.linePosition = linePosition; break; case DrawToolType.MeasureLength: //长度测量->长度 this.measureStyleModel.measureLength.font = font; this.measureStyleModel.measureLength.fontSize = fontSize; this.measureStyleModel.measureLength.textColor = textColor; this.measureStyleModel.measureLength.lineColor = lineColor; this.measureStyleModel.measureLength.lineWidth = lineWidth; this.measureStyleModel.measureLength.lineStyle = lineStyle; this.measureStyleModel.measureLength.linePosition = linePosition; break; case DrawToolType.MeasureHLine: //长度测量->水平线 this.measureStyleModel.measureHLine.font = font; this.measureStyleModel.measureHLine.fontSize = fontSize; this.measureStyleModel.measureHLine.textColor = textColor; this.measureStyleModel.measureHLine.lineColor = lineColor; this.measureStyleModel.measureHLine.lineWidth = lineWidth; this.measureStyleModel.measureHLine.lineStyle = lineStyle; this.measureStyleModel.measureHLine.linePosition = linePosition; this.measureStyleModel.measureHLine.vLineLength = vLineLength; break; case DrawToolType.MeasureVLine: //长度测量->垂线 this.measureStyleModel.measureVLine.font = font; this.measureStyleModel.measureVLine.fontSize = fontSize; this.measureStyleModel.measureVLine.textColor = textColor; this.measureStyleModel.measureVLine.lineColor = lineColor; this.measureStyleModel.measureVLine.lineWidth = lineWidth; this.measureStyleModel.measureVLine.lineStyle = lineStyle; this.measureStyleModel.measureVLine.linePosition = linePosition; this.measureStyleModel.measureVLine.vLineLength = vLineLength; this.measureStyleModel.measureVLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false; break; case DrawToolType.MeasureMulLine: //多点线段->多点直线 this.measureStyleModel.measureMulLine.font = font; this.measureStyleModel.measureMulLine.fontSize = fontSize; this.measureStyleModel.measureMulLine.textColor = textColor; this.measureStyleModel.measureMulLine.lineColor = lineColor; this.measureStyleModel.measureMulLine.lineWidth = lineWidth; this.measureStyleModel.measureMulLine.lineStyle = lineStyle; this.measureStyleModel.measureMulLine.linePositionL = linePositionL; this.measureStyleModel.measureMulLine.linePositionP = linePositionP; this.measureStyleModel.measureMulLine.vLineLength = vLineLength; break; case DrawToolType.MeasureMulHVLine: //多点线段->多点水平线 this.measureStyleModel.measureMulHVLine.font = font; this.measureStyleModel.measureMulHVLine.fontSize = fontSize; this.measureStyleModel.measureMulHVLine.textColor = textColor; this.measureStyleModel.measureMulHVLine.lineColor = lineColor; this.measureStyleModel.measureMulHVLine.lineWidth = lineWidth; this.measureStyleModel.measureMulHVLine.lineStyle = lineStyle; this.measureStyleModel.measureMulHVLine.linePositionL = linePositionL; this.measureStyleModel.measureMulHVLine.linePositionP = linePositionP; this.measureStyleModel.measureMulHVLine.vLineLength = vLineLength; break; case DrawToolType.MeasureMulSegment: //多点线段->多点线段 this.measureStyleModel.measureMulSegment.font = font; this.measureStyleModel.measureMulSegment.fontSize = fontSize; this.measureStyleModel.measureMulSegment.textColor = textColor; this.measureStyleModel.measureMulSegment.lineColor = lineColor; this.measureStyleModel.measureMulSegment.lineWidth = lineWidth; this.measureStyleModel.measureMulSegment.lineStyle = lineStyle; this.measureStyleModel.measureMulSegment.linePositionL = linePositionL; this.measureStyleModel.measureMulSegment.linePositionP = linePositionP; this.measureStyleModel.measureMulSegment.vLineLength = vLineLength; break; case DrawToolType.MeasureMulVLine: //多点线段->多点垂直线 this.measureStyleModel.measureMulVLine.font = font; this.measureStyleModel.measureMulVLine.fontSize = fontSize; this.measureStyleModel.measureMulVLine.textColor = textColor; this.measureStyleModel.measureMulVLine.lineColor = lineColor; this.measureStyleModel.measureMulVLine.lineWidth = lineWidth; this.measureStyleModel.measureMulVLine.lineStyle = lineStyle; this.measureStyleModel.measureMulVLine.linePositionL = linePositionL; this.measureStyleModel.measureMulVLine.linePositionP = linePositionP; this.measureStyleModel.measureMulVLine.vLineLength = vLineLength; this.measureStyleModel.measureMulVLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false; break; case DrawToolType.MeasureBrokenLine: //曲线长度->折线 this.measureStyleModel.measureBrokenLine.font = font; this.measureStyleModel.measureBrokenLine.fontSize = fontSize; this.measureStyleModel.measureBrokenLine.textColor = textColor; this.measureStyleModel.measureBrokenLine.lineColor = lineColor; this.measureStyleModel.measureBrokenLine.lineWidth = lineWidth; this.measureStyleModel.measureBrokenLine.lineStyle = lineStyle; this.measureStyleModel.measureBrokenLine.linePosition = linePosition; break; case DrawToolType.MeasureTraceCurve: //曲线长度->轨迹曲线 this.measureStyleModel.measureTraceCurve.font = font; this.measureStyleModel.measureTraceCurve.fontSize = fontSize; this.measureStyleModel.measureTraceCurve.textColor = textColor; this.measureStyleModel.measureTraceCurve.lineColor = lineColor; this.measureStyleModel.measureTraceCurve.lineWidth = lineWidth; this.measureStyleModel.measureTraceCurve.lineStyle = lineStyle; this.measureStyleModel.measureTraceCurve.linePosition = linePosition; break; case DrawToolType.MeasureCurveLine: //曲线长度->曲线 this.measureStyleModel.measureCurveLine.font = font; this.measureStyleModel.measureCurveLine.fontSize = fontSize; this.measureStyleModel.measureCurveLine.textColor = textColor; this.measureStyleModel.measureCurveLine.lineColor = lineColor; this.measureStyleModel.measureCurveLine.lineWidth = lineWidth; this.measureStyleModel.measureCurveLine.lineStyle = lineStyle; this.measureStyleModel.measureCurveLine.linePosition = linePosition; break; case DrawToolType.MeasurePLine: //点垂线->点垂线 this.measureStyleModel.measurePLine.font = font; this.measureStyleModel.measurePLine.fontSize = fontSize; this.measureStyleModel.measurePLine.textColor = textColor; this.measureStyleModel.measurePLine.lineColor = lineColor; this.measureStyleModel.measurePLine.lineWidth = lineWidth; this.measureStyleModel.measurePLine.lineStyle = lineStyle; this.measureStyleModel.measurePLine.linePositionL = linePositionL; this.measureStyleModel.measurePLine.linePositionP = linePositionP; break; case DrawToolType.MeasureMulPLine: //点垂线->多点垂线 this.measureStyleModel.measureMulPLine.font = font; this.measureStyleModel.measureMulPLine.fontSize = fontSize; this.measureStyleModel.measureMulPLine.textColor = textColor; this.measureStyleModel.measureMulPLine.lineColor = lineColor; this.measureStyleModel.measureMulPLine.lineWidth = lineWidth; this.measureStyleModel.measureMulPLine.lineStyle = lineStyle; this.measureStyleModel.measureMulPLine.linePositionL = linePositionL; this.measureStyleModel.measureMulPLine.linePositionP = linePositionP; break; case DrawToolType.MeasureHMulPLine: //点垂线->水平多点垂线 this.measureStyleModel.measureHMulPLine.font = font; this.measureStyleModel.measureHMulPLine.fontSize = fontSize; this.measureStyleModel.measureHMulPLine.textColor = textColor; this.measureStyleModel.measureHMulPLine.lineColor = lineColor; this.measureStyleModel.measureHMulPLine.lineWidth = lineWidth; this.measureStyleModel.measureHMulPLine.lineStyle = lineStyle; this.measureStyleModel.measureHMulPLine.linePositionL = linePositionL; this.measureStyleModel.measureHMulPLine.linePositionP = linePositionP; break; case DrawToolType.MeasureVMulPLine: //点垂线->垂直多点垂线 this.measureStyleModel.measureVMulPLine.font = font; this.measureStyleModel.measureVMulPLine.fontSize = fontSize; this.measureStyleModel.measureVMulPLine.textColor = textColor; this.measureStyleModel.measureVMulPLine.lineColor = lineColor; this.measureStyleModel.measureVMulPLine.lineWidth = lineWidth; this.measureStyleModel.measureVMulPLine.lineStyle = lineStyle; this.measureStyleModel.measureVMulPLine.linePositionL = linePositionL; this.measureStyleModel.measureVMulPLine.linePositionP = linePositionP; break; case DrawToolType.MeasurePointHLine: //点垂线->点到水平线距离 this.measureStyleModel.measurePointHLine.font = font; this.measureStyleModel.measurePointHLine.fontSize = fontSize; this.measureStyleModel.measurePointHLine.textColor = textColor; this.measureStyleModel.measurePointHLine.lineColor = lineColor; this.measureStyleModel.measurePointHLine.lineWidth = lineWidth; this.measureStyleModel.measurePointHLine.lineStyle = lineStyle; this.measureStyleModel.measurePointHLine.linePositionL = linePositionL; this.measureStyleModel.measurePointHLine.linePositionP = linePositionP; break; case DrawToolType.MeasureParallelLine: //平行线测量->平行线 this.measureStyleModel.measureParallelLine.font = font; this.measureStyleModel.measureParallelLine.fontSize = fontSize; this.measureStyleModel.measureParallelLine.textColor = textColor; this.measureStyleModel.measureParallelLine.lineColor = lineColor; this.measureStyleModel.measureParallelLine.lineWidth = lineWidth; this.measureStyleModel.measureParallelLine.lineStyle = lineStyle; this.measureStyleModel.measureParallelLine.linePositionL = linePositionL; this.measureStyleModel.measureParallelLine.linePositionP = linePositionP; this.measureStyleModel.measureParallelLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false; break; case DrawToolType.MeasureMulParallelLine: //平行线测量->多点平行线 this.measureStyleModel.measureMulParallelLine.font = font; this.measureStyleModel.measureMulParallelLine.fontSize = fontSize; this.measureStyleModel.measureMulParallelLine.textColor = textColor; this.measureStyleModel.measureMulParallelLine.lineColor = lineColor; this.measureStyleModel.measureMulParallelLine.lineWidth = lineWidth; this.measureStyleModel.measureMulParallelLine.lineStyle = lineStyle; this.measureStyleModel.measureMulParallelLine.linePositionL = linePositionL; this.measureStyleModel.measureMulParallelLine.linePositionP = linePositionP; break; case DrawToolType.MeasureVMulParallelLine: //平行线测量->垂直多点平行线 this.measureStyleModel.measureVMulParallelLine.font = font; this.measureStyleModel.measureVMulParallelLine.fontSize = fontSize; this.measureStyleModel.measureVMulParallelLine.textColor = textColor; this.measureStyleModel.measureVMulParallelLine.lineColor = lineColor; this.measureStyleModel.measureVMulParallelLine.lineWidth = lineWidth; this.measureStyleModel.measureVMulParallelLine.lineStyle = lineStyle; this.measureStyleModel.measureVMulParallelLine.linePositionL = linePositionL; this.measureStyleModel.measureVMulParallelLine.linePositionP = linePositionP; break; case DrawToolType.MeasureHMulParallelLine: //平行线测量->水平多点平行线 this.measureStyleModel.measureHMulParallelLine.font = font; this.measureStyleModel.measureHMulParallelLine.fontSize = fontSize; this.measureStyleModel.measureHMulParallelLine.textColor = textColor; this.measureStyleModel.measureHMulParallelLine.lineColor = lineColor; this.measureStyleModel.measureHMulParallelLine.lineWidth = lineWidth; this.measureStyleModel.measureHMulParallelLine.lineStyle = lineStyle; this.measureStyleModel.measureHMulParallelLine.linePositionL = linePositionL; this.measureStyleModel.measureHMulParallelLine.linePositionP = linePositionP; break; case DrawToolType.MeasureClosedCurve: //多边形测量->闭合曲线 this.measureStyleModel.measureClosedCurve.font = font; this.measureStyleModel.measureClosedCurve.fontSize = fontSize; this.measureStyleModel.measureClosedCurve.textColor = textColor; this.measureStyleModel.measureClosedCurve.lineColor = lineColor; this.measureStyleModel.measureClosedCurve.lineWidth = lineWidth; this.measureStyleModel.measureClosedCurve.lineStyle = lineStyle; break; case DrawToolType.MeasurePolygon: //多边形测量->多边形 this.measureStyleModel.measurePolygon.font = font; this.measureStyleModel.measurePolygon.fontSize = fontSize; this.measureStyleModel.measurePolygon.textColor = textColor; this.measureStyleModel.measurePolygon.lineColor = lineColor; this.measureStyleModel.measurePolygon.lineWidth = lineWidth; this.measureStyleModel.measurePolygon.lineStyle = lineStyle; break; case DrawToolType.MeasureRectangle: //多边形测量->矩形 this.measureStyleModel.measureRectangle.font = font; this.measureStyleModel.measureRectangle.fontSize = fontSize; this.measureStyleModel.measureRectangle.textColor = textColor; this.measureStyleModel.measureRectangle.lineColor = lineColor; this.measureStyleModel.measureRectangle.lineWidth = lineWidth; this.measureStyleModel.measureRectangle.lineStyle = lineStyle; break; case DrawToolType.MeasureRandRectangle: //多边形测量->任意矩形 this.measureStyleModel.measureRandRectangle.font = font; this.measureStyleModel.measureRandRectangle.fontSize = fontSize; this.measureStyleModel.measureRandRectangle.textColor = textColor; this.measureStyleModel.measureRandRectangle.lineColor = lineColor; this.measureStyleModel.measureRandRectangle.lineWidth = lineWidth; this.measureStyleModel.measureRandRectangle.lineStyle = lineStyle; break; case DrawToolType.MeasureSquare: //多边形测量->正方形 this.measureStyleModel.measureSquare.font = font; this.measureStyleModel.measureSquare.fontSize = fontSize; this.measureStyleModel.measureSquare.textColor = textColor; this.measureStyleModel.measureSquare.lineColor = lineColor; this.measureStyleModel.measureSquare.lineWidth = lineWidth; this.measureStyleModel.measureSquare.lineStyle = lineStyle; break; case DrawToolType.MeasureRandSquare: //多边形测量->任意正方形 this.measureStyleModel.measureRandSquare.font = font; this.measureStyleModel.measureRandSquare.fontSize = fontSize; this.measureStyleModel.measureRandSquare.textColor = textColor; this.measureStyleModel.measureRandSquare.lineColor = lineColor; this.measureStyleModel.measureRandSquare.lineWidth = lineWidth; this.measureStyleModel.measureRandSquare.lineStyle = lineStyle; break; case DrawToolType.MeasureTracePolygon: //多边形测量->轨迹多边形 this.measureStyleModel.measureTracePolygon.font = font; this.measureStyleModel.measureTracePolygon.fontSize = fontSize; this.measureStyleModel.measureTracePolygon.textColor = textColor; this.measureStyleModel.measureTracePolygon.lineColor = lineColor; this.measureStyleModel.measureTracePolygon.lineWidth = lineWidth; this.measureStyleModel.measureTracePolygon.lineStyle = lineStyle; break; case DrawToolType.MeasureCircle: //圆形测量->三点圆 this.measureStyleModel.measureCircle.font = font; this.measureStyleModel.measureCircle.fontSize = fontSize; this.measureStyleModel.measureCircle.textColor = textColor; this.measureStyleModel.measureCircle.lineColor = lineColor; this.measureStyleModel.measureCircle.lineWidth = lineWidth; this.measureStyleModel.measureCircle.lineStyle = lineStyle; break; case DrawToolType.MeasureInnerCircle: //圆形测量->向内画圆 this.measureStyleModel.measureInnerCircle.font = font; this.measureStyleModel.measureInnerCircle.fontSize = fontSize; this.measureStyleModel.measureInnerCircle.textColor = textColor; this.measureStyleModel.measureInnerCircle.lineColor = lineColor; this.measureStyleModel.measureInnerCircle.lineWidth = lineWidth; this.measureStyleModel.measureInnerCircle.lineStyle = lineStyle; break; case DrawToolType.MeasureOuterCircle: //圆形测量->向外画圆 this.measureStyleModel.measureOuterCircle.font = font; this.measureStyleModel.measureOuterCircle.fontSize = fontSize; this.measureStyleModel.measureOuterCircle.textColor = textColor; this.measureStyleModel.measureOuterCircle.lineColor = lineColor; this.measureStyleModel.measureOuterCircle.lineWidth = lineWidth; this.measureStyleModel.measureOuterCircle.lineStyle = lineStyle; break; case DrawToolType.MeasureDiameterCircle: //圆形测量->直径画圆 this.measureStyleModel.measureDiameterCircle.font = font; this.measureStyleModel.measureDiameterCircle.fontSize = fontSize; this.measureStyleModel.measureDiameterCircle.textColor = textColor; this.measureStyleModel.measureDiameterCircle.lineColor = lineColor; this.measureStyleModel.measureDiameterCircle.lineWidth = lineWidth; this.measureStyleModel.measureDiameterCircle.lineStyle = lineStyle; break; case DrawToolType.MeasurePointEdgeSize: //圆形测量->点到圆距离 this.measureStyleModel.measurePointEdgeSize.font = font; this.measureStyleModel.measurePointEdgeSize.fontSize = fontSize; this.measureStyleModel.measurePointEdgeSize.textColor = textColor; this.measureStyleModel.measurePointEdgeSize.lineColor = lineColor; this.measureStyleModel.measurePointEdgeSize.lineWidth = lineWidth; this.measureStyleModel.measurePointEdgeSize.lineStyle = lineStyle; break; case DrawToolType.MeasurePointCenterSize: //圆形测量->点到圆心距离 this.measureStyleModel.measurePointCenterSize.font = font; this.measureStyleModel.measurePointCenterSize.fontSize = fontSize; this.measureStyleModel.measurePointCenterSize.textColor = textColor; this.measureStyleModel.measurePointCenterSize.lineColor = lineColor; this.measureStyleModel.measurePointCenterSize.lineWidth = lineWidth; this.measureStyleModel.measurePointCenterSize.lineStyle = lineStyle; break; case DrawToolType.MeasurePointArcSize: //圆形测量->点到圆弧距离 this.measureStyleModel.measurePointArcSize.font = font; this.measureStyleModel.measurePointArcSize.fontSize = fontSize; this.measureStyleModel.measurePointArcSize.textColor = textColor; this.measureStyleModel.measurePointArcSize.lineColor = lineColor; this.measureStyleModel.measurePointArcSize.lineWidth = lineWidth; this.measureStyleModel.measurePointArcSize.lineStyle = lineStyle; break; case DrawToolType.MeasureThreePointAngle: //角度测量->三点角度 this.measureStyleModel.measureThreePointAngle.font = font; this.measureStyleModel.measureThreePointAngle.fontSize = fontSize; this.measureStyleModel.measureThreePointAngle.textColor = textColor; this.measureStyleModel.measureThreePointAngle.lineColor = lineColor; this.measureStyleModel.measureThreePointAngle.lineWidth = lineWidth; this.measureStyleModel.measureThreePointAngle.lineStyle = lineStyle; this.measureStyleModel.measureThreePointAngle.isAngle = isAngle; break; case DrawToolType.MeasureFourPointAngle: //角度测量->四点角度 this.measureStyleModel.measureFourPointAngle.font = font; this.measureStyleModel.measureFourPointAngle.fontSize = fontSize; this.measureStyleModel.measureFourPointAngle.textColor = textColor; this.measureStyleModel.measureFourPointAngle.lineColor = lineColor; this.measureStyleModel.measureFourPointAngle.lineWidth = lineWidth; this.measureStyleModel.measureFourPointAngle.lineStyle = lineStyle; this.measureStyleModel.measureFourPointAngle.isAngle = isAngle; break; case DrawToolType.MeasureThreePointArc: //角度测量->三点弧 this.measureStyleModel.measureThreePointArc.font = font; this.measureStyleModel.measureThreePointArc.fontSize = fontSize; this.measureStyleModel.measureThreePointArc.textColor = textColor; this.measureStyleModel.measureThreePointArc.lineColor = lineColor; this.measureStyleModel.measureThreePointArc.lineWidth = lineWidth; this.measureStyleModel.measureThreePointArc.lineStyle = lineStyle; this.measureStyleModel.measureThreePointArc.isAngle = isAngle; break; case DrawToolType.MeasureCenterCenterSize: //对准度测量->圆心到圆心距离 this.measureStyleModel.measureCenterCenterSize.font = font; this.measureStyleModel.measureCenterCenterSize.fontSize = fontSize; this.measureStyleModel.measureCenterCenterSize.textColor = textColor; this.measureStyleModel.measureCenterCenterSize.lineColor = lineColor; this.measureStyleModel.measureCenterCenterSize.lineWidth = lineWidth; this.measureStyleModel.measureCenterCenterSize.lineStyle = lineStyle; this.measureStyleModel.measureCenterCenterSize.linePosition = linePosition; break; case DrawToolType.MeasureTwoLineVLDistance: //对准度测量->两线中垂线距离 this.measureStyleModel.measureTwoLineVLDistance.font = font; this.measureStyleModel.measureTwoLineVLDistance.fontSize = fontSize; this.measureStyleModel.measureTwoLineVLDistance.textColor = textColor; this.measureStyleModel.measureTwoLineVLDistance.lineColor = lineColor; this.measureStyleModel.measureTwoLineVLDistance.lineWidth = lineWidth; this.measureStyleModel.measureTwoLineVLDistance.lineStyle = lineStyle; this.measureStyleModel.measureTwoLineVLDistance.linePosition = linePosition; break; } } /// /// 应用 /// /// /// private void button1_Click(object sender, EventArgs e) { button2_Click(); //修改缓存中的样式数据 Startup.instance.measureStyleModel = this.measureStyleModel; //修改主配置文件中的值 configModel.MeasurementStyle = "Default.xml"; //修改主配置文件的xml string configModelXml = XmlSerializeHelper.XmlSerialize(this.configModel); string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Config.xml"; FileOperationHelper.WriteStringToFile(configModelXml, filePath, FileMode.Create); MessageBox.Show(PdnResources.GetString("Menu.Applicationsuccessfully.Text")); ((MeasureDrawObject)(this.drawObject)).mouseUpAttribute = true; this.appWorkspace.ActiveDocumentWorkspace.Refresh(); this.appWorkspace.RefreshListView(); this.Close(); } /// /// 关闭 /// /// /// private void button3_Click(object sender, EventArgs e) { this.Close(); } } }