| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 | using PaintDotNet.Base.DedicatedAnalysis.Inclusions;using PaintDotNet.Base.DedicatedAnalysis.Inclusions.Standard.ASTME45;using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace PaintDotNet.DedicatedAnalysis.Inclusions.ASTME45{    internal class MethodADialog : InclusionsStandardDialog    {        #region 组件        private RadioButton radioButton_DarkGray;        private RadioButton radioButton_Gray;        private RadioButton radioButton_LightBlue;        private Panel panel_displaySetting_A;        private Panel panel_displaySetting_C;        private Button label_displaySetting_D;        private Panel panel_displaySetting_B;        private Panel panel_displaySetting_D;        private Button label_displaySetting_C;        private Button label_displaySetting_A;        private Button label_displaySetting_B;        private RadioButton radioButton_Black;        #endregion 组件        #region 构造函数        public MethodADialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuItem) : base(appWorkspace, dialogText, menuItem)        {        }        #endregion 构造函数        #region 初始化组件        private void InitializeComponent()        {            this.radioButton_DarkGray = new System.Windows.Forms.RadioButton();            this.radioButton_Gray = new System.Windows.Forms.RadioButton();            this.radioButton_LightBlue = new System.Windows.Forms.RadioButton();            this.radioButton_Black = new System.Windows.Forms.RadioButton();            this.panel_displaySetting_A = new System.Windows.Forms.Panel();            this.panel_displaySetting_C = new System.Windows.Forms.Panel();            this.label_displaySetting_D = new System.Windows.Forms.Button();            this.panel_displaySetting_B = new System.Windows.Forms.Panel();            this.panel_displaySetting_D = new System.Windows.Forms.Panel();            this.label_displaySetting_C = new System.Windows.Forms.Button();            this.label_displaySetting_A = new System.Windows.Forms.Button();            this.label_displaySetting_B = new System.Windows.Forms.Button();            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit();            this.groupBox_colorSetting.SuspendLayout();            this.groupBox_displaySetting.SuspendLayout();            this.SuspendLayout();            //             // numericUpDown_lwRatioLimit            //             this.numericUpDown_lwRatioLimit.Value = new decimal(new int[] {            2,            0,            0,            0});            //             // groupBox_colorSetting            //             this.groupBox_colorSetting.Controls.Add(this.radioButton_DarkGray);            this.groupBox_colorSetting.Controls.Add(this.radioButton_Gray);            this.groupBox_colorSetting.Controls.Add(this.radioButton_LightBlue);            this.groupBox_colorSetting.Controls.Add(this.radioButton_Black);            this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Black, 0);            this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_LightBlue, 0);            this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Gray, 0);            this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_DarkGray, 0);            //             // groupBox_displaySetting            //             this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_A);            this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_C);            this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_D);            this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_B);            this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_D);            this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_C);            this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_A);            this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_B);            //             // radioButton_DarkGray            //             this.radioButton_DarkGray.AutoSize = true;            this.radioButton_DarkGray.Location = new System.Drawing.Point(178, 20);            this.radioButton_DarkGray.Name = "radioButton_DarkGray";            this.radioButton_DarkGray.Size = new System.Drawing.Size(59, 16);            this.radioButton_DarkGray.TabIndex = 38;            this.radioButton_DarkGray.TabStop = true;            this.radioButton_DarkGray.Text = PdnResources.GetString("Menu.Darkgray.text");            this.radioButton_DarkGray.UseVisualStyleBackColor = true;            //             // radioButton_Gray            //             this.radioButton_Gray.AutoSize = true;            this.radioButton_Gray.Location = new System.Drawing.Point(125, 20);            this.radioButton_Gray.Name = "radioButton_Gray";            this.radioButton_Gray.Size = new System.Drawing.Size(47, 16);            this.radioButton_Gray.TabIndex = 37;            this.radioButton_Gray.TabStop = true;            this.radioButton_Gray.Text = PdnResources.GetString("Menu.gray.text");            this.radioButton_Gray.UseVisualStyleBackColor = true;            //             // radioButton_LightBlue            //             this.radioButton_LightBlue.AutoSize = true;            this.radioButton_LightBlue.Location = new System.Drawing.Point(60, 20);            this.radioButton_LightBlue.Name = "radioButton_LightBlue";            this.radioButton_LightBlue.Size = new System.Drawing.Size(59, 16);            this.radioButton_LightBlue.TabIndex = 36;            this.radioButton_LightBlue.TabStop = true;            this.radioButton_LightBlue.Text = PdnResources.GetString("Menu.Bluish.text");            this.radioButton_LightBlue.UseVisualStyleBackColor = true;            //             // radioButton_Black            //             this.radioButton_Black.AutoSize = true;            this.radioButton_Black.Location = new System.Drawing.Point(7, 20);            this.radioButton_Black.Name = "radioButton_Black";            this.radioButton_Black.Size = new System.Drawing.Size(47, 16);            this.radioButton_Black.TabIndex = 35;            this.radioButton_Black.TabStop = true;            this.radioButton_Black.Text = PdnResources.GetString("Menu.black.text");            this.radioButton_Black.UseVisualStyleBackColor = true;            //             // panel_displaySetting_A            //             this.panel_displaySetting_A.Location = new System.Drawing.Point(44, 17);            this.panel_displaySetting_A.Name = "panel_displaySetting_A";            this.panel_displaySetting_A.Size = new System.Drawing.Size(21, 21);            this.panel_displaySetting_A.TabIndex = 34;            //             // panel_displaySetting_C            //             this.panel_displaySetting_C.BackColor = System.Drawing.SystemColors.Control;            this.panel_displaySetting_C.Location = new System.Drawing.Point(152, 17);            this.panel_displaySetting_C.Name = "panel_displaySetting_C";            this.panel_displaySetting_C.Size = new System.Drawing.Size(21, 21);            this.panel_displaySetting_C.TabIndex = 35;            //             // label_displaySetting_D            //             this.label_displaySetting_D.AutoSize = true;            this.label_displaySetting_D.Location = new System.Drawing.Point(185, 17);            this.label_displaySetting_D.Name = "label_displaySetting_D";            this.label_displaySetting_D.Size = new System.Drawing.Size(21, 22);            this.label_displaySetting_D.TabIndex = 41;            this.label_displaySetting_D.Text = "D";            //             // panel_displaySetting_B            //             this.panel_displaySetting_B.BackColor = System.Drawing.SystemColors.Control;            this.panel_displaySetting_B.Location = new System.Drawing.Point(98, 17);            this.panel_displaySetting_B.Name = "panel_displaySetting_B";            this.panel_displaySetting_B.Size = new System.Drawing.Size(21, 21);            this.panel_displaySetting_B.TabIndex = 33;            //             // panel_displaySetting_D            //             this.panel_displaySetting_D.BackColor = System.Drawing.SystemColors.Control;            this.panel_displaySetting_D.Location = new System.Drawing.Point(212, 17);            this.panel_displaySetting_D.Name = "panel_displaySetting_D";            this.panel_displaySetting_D.Size = new System.Drawing.Size(21, 21);            this.panel_displaySetting_D.TabIndex = 36;            //             // label_displaySetting_C            //             this.label_displaySetting_C.AutoSize = true;            this.label_displaySetting_C.Location = new System.Drawing.Point(125, 17);            this.label_displaySetting_C.Name = "label_displaySetting_C";            this.label_displaySetting_C.Size = new System.Drawing.Size(21, 22);            this.label_displaySetting_C.TabIndex = 40;            this.label_displaySetting_C.Text = "C";            //             // label_displaySetting_A            //             this.label_displaySetting_A.AutoSize = true;            this.label_displaySetting_A.Location = new System.Drawing.Point(17, 17);            this.label_displaySetting_A.Name = "label_displaySetting_A";            this.label_displaySetting_A.Size = new System.Drawing.Size(21, 22);            this.label_displaySetting_A.TabIndex = 38;            this.label_displaySetting_A.Text = "A";            //             // label_displaySetting_B            //             this.label_displaySetting_B.AutoSize = true;            this.label_displaySetting_B.Location = new System.Drawing.Point(71, 17);            this.label_displaySetting_B.Name = "label_displaySetting_B";            this.label_displaySetting_B.Size = new System.Drawing.Size(21, 22);            this.label_displaySetting_B.TabIndex = 39;            this.label_displaySetting_B.Text = "B";            //             // MethodADialog            //             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);            this.ClientSize = new System.Drawing.Size(1177, 908);            this.Name = "MethodADialog";            this.Text = "ASTME45_MethodA("+ PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text")+ ")";            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit();            this.groupBox_colorSetting.ResumeLayout(false);            this.groupBox_colorSetting.PerformLayout();            this.groupBox_displaySetting.ResumeLayout(false);            this.groupBox_displaySetting.PerformLayout();            this.ResumeLayout(false);        }        #endregion 初始化组件        #region 需继承方法        protected override void SubclassInitialize()        {            InitializeComponent();            this.radioButton_Black.Checked = true;            this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];        }        protected override MethodOfAssessment getMethodOfAssessment()        {            return new MethodA(this.imgPxPerUnit);        }        protected override void initColorSetting()        {            this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);            this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);            this.radioButton_LightBlue.CheckedChanged += new System.EventHandler(colorSettingRadioButton);            this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);        }        protected override void initDisplaySetting()        {            this.panel_displaySetting_A.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["A"].showColor);            this.panel_displaySetting_B.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["B"].showColor);            this.panel_displaySetting_C.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["C"].showColor);            this.panel_displaySetting_D.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["D"].showColor);        }        protected override void getInclusionParameters()        {            switch (whichChecked)            {                case 0:                    radioButton_Black.Checked = true;                    this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];                    break;                case 1:                    radioButton_Black.Checked = true;                    this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];                    break;                case 2:                    radioButton_LightBlue.Checked = true;                    this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["LightBlue"];                    break;                case 3:                    radioButton_Gray.Checked = true;                    this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Gray"];                    break;                case 4:                    radioButton_DarkGray.Checked = true;                    this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["DarkGray"];                    break;            }        }        protected override void saveInclusionParameters()        {            if (radioButton_Black.Checked)            {                thisParameters.parameter3 = 1;            }            else if (radioButton_LightBlue.Checked)            {                thisParameters.parameter3 = 2;            }            else if (radioButton_Gray.Checked)            {                thisParameters.parameter3 = 3;            }            else if (radioButton_DarkGray.Checked)            {                thisParameters.parameter3 = 4;            }        }        protected override void getOldCheck()        {            this.radioButton_Black.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);            this.radioButton_Gray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);            this.radioButton_LightBlue.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);            this.radioButton_DarkGray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);            switch (colorName)            {                case "Black":                    radioButton_Black.Checked = true;                    break;                case "Gray":                    radioButton_Gray.Checked = true;                    break;                case "DarkGray":                    radioButton_DarkGray.Checked = true;                    break;                case "LightBlue":                    radioButton_LightBlue.Checked = true;                    break;            }            this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);            this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);            this.radioButton_LightBlue.CheckedChanged += new System.EventHandler(colorSettingRadioButton);            this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);        }        #endregion 需继承方法    }}
 |