| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 | using Resources;using SmartCoalApplication.Base.CommTool;using SmartCoalApplication.Base.SettingModel;using SmartCoalApplication.Core;using SmartCoalApplication.PluginAssemblys;using System;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 SmartCoalApplication.MeasureProcedure{    public partial class AuxiliaryLineSetting : Form    {       private ColorsForm colorsForm;        public AuxiliaryLineSetting()        {            InitializeComponent();            setLanguege();            GuideSetting();        }        private void setLanguege ()        {            this.groupBox1.Text = PdnResources.GetString("AuxiliaryLineSetting.groupBox1");            this.buttonDetermine.Text = PdnResources.GetString("AuxiliaryLineSetting.buttonDetermine");            this.buttonCancel.Text = PdnResources.GetString("AuxiliaryLineSetting.buttonCancel");            this.groupBox16.Text = PdnResources.GetString("AuxiliaryLineSetting.groupBox16");            this.label26.Text = PdnResources.GetString("AuxiliaryLineSetting.label26");            this.label27.Text = PdnResources.GetString("AuxiliaryLineSetting.label27");            this.label28.Text = PdnResources.GetString("AuxiliaryLineSetting.label28");        }        #region [辅助线设置]        public void GuideSetting()        {            //绑定线样式数据            this.comboBox2.Items.AddRange(InvariantData.dashStyles);            //获取xml样式信息            this.comboBox2.SelectedIndex = Program.instance.configModel.girdLineStyle;            this.panel6.BackColor = Color.FromArgb(Program.instance.configModel.girdLineColour);            this.numericUpDown1.Value = Program.instance.configModel.girdLineWidth;            //            //画板            //            this.colorsForm = new ColorsForm();            this.colorsForm.StartPosition = FormStartPosition.CenterScreen;            this.colorsForm.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);        }        #endregion        #region [画板颜色]        /// <summary>        /// 画板点击        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void panel6_Click(object sender, EventArgs e)        {            this.colorsForm.UserPrimaryColor = ColorBgra.FromColor(this.panel6.BackColor);            this.colorsForm.setSaveBtn_Click(new System.EventHandler(this.panel6Changed));            this.colorsForm.ShowDialog();        }        private void panel6Changed(object sender, EventArgs e)        {            this.panel6.BackColor = this.colorsForm.UserPrimaryColor.ToColor();            this.colorsForm.Close();        }        private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)        {        }        #endregion        /// <summary>        /// 确定        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void buttonDetermine_Click(object sender, EventArgs e)        {            Program.instance.configModel.girdLineStyle = this.comboBox2.SelectedIndex;            Program.instance.configModel.girdLineColour = this.panel6.BackColor.ToArgb();            Program.instance.configModel.girdLineWidth = Convert.ToInt32(this.numericUpDown1.Value);            string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\Config.xml";            string configModelXml = XmlSerializeHelper.XmlSerialize<ConfigModel>(Program.instance.configModel);            FileOperationHelper.WriteStringToFile(configModelXml, filePath, FileMode.Create);            this.Close();        }        /// <summary>        /// 取消        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void buttonCancel_Click(object sender, EventArgs e)        {            this.Close();        }    }}
 |