/// <summary> /// 全局配置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GoladToolStripMenuItem_Click(object sender, EventArgs e) { Setting_Global frm = new Setting_Global(); frm.TransfEvent += frm_TransfEvent; frm.ShowDialog(); }
public Main() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; AddMsg("已启动程序"); string sJson = string.Empty; #region 加载全局配置 if (!File.Exists(LibClass.ConstValue.JSON_Global)) { LibClass.OpenCoverModel.GlobalModel modelTemp = new LibClass.OpenCoverModel.GlobalModel(); string sTempJson = Soholife.Common.Json.ConvertToJson.ObjectToJSON(modelTemp); Soholife.Common.IO.FileUtils.WriteFile(LibClass.ConstValue.JSON_Global, sTempJson); } using (StreamReader sr = new StreamReader(System.AppDomain.CurrentDomain.BaseDirectory + LibClass.ConstValue.JSON_Global, System.Text.Encoding.UTF8)) { sJson = sr.ReadToEnd(); } golbalModel = Soholife.Common.Json.ConvertToJson.ParseFormJson <LibClass.OpenCoverModel.GlobalModel>(sJson); if (!File.Exists(golbalModel.OpenCover)) { MessageBox.Show("请设置 Opencover路径"); Setting_Global frm = new Setting_Global(); frm.TransfEvent += frm_TransfEvent; frm.ShowDialog(); } if (!File.Exists(golbalModel.ReportGenerator)) { MessageBox.Show("请设置ReportGenerator路径"); Setting_Global frm = new Setting_Global(); frm.TransfEvent += frm_TransfEvent; frm.ShowDialog(); } if (!File.Exists(golbalModel.ApplicationHost)) { MessageBox.Show("请设置ApplicationHost路径"); Setting_Global frm = new Setting_Global(); frm.TransfEvent += frm_TransfEvent; frm.ShowDialog(); } #endregion }