async void SafeStart() { // Change Text var text = BtnStartXYWE.Text; BtnStartXYWE.Text = "正在启动XYWE……"; BtnStartXYWE.Enabled = false; BtnStartXYWE.Refresh(); // http://stackoverflow.com/questions/570537/update-label-while-processing-in-windows-forms // Refresh Tip XYTip.Refresh(); // Refresh Editor Source XYSource.RefreshEditor(); // Compile await Task.Run(() => { XYFile.Compile(XYPath.Dir.Source); }); // Refresh Enabled Package UI Config XYConfig.RefreshConfig(); // Execute Plugin if (XYPlugin.RSJB_WE_TextEditor_16_0.GetEnableState()) { XYPlugin.RSJB_WE_TextEditor_16_0.SafeStart(); } // Recover Text BtnStartXYWE.Enabled = true; BtnStartXYWE.Text = text; // Start XYWE XYProcess.Application.StartXYWE(); }
private void FormXYWE_Load(object sender, EventArgs e) { LlVersion.Text = XYInfo.Version; cbEnableRSJBWETextEditor16_0.Checked = XYPlugin.RSJB_WE_TextEditor_16_0.GetEnableState(); XYTip.UpdateTipAsync(); cbUI.SelectedItem = XYConfig.GetCurrentStandardUI(); FormClosing += FormXYWE_FormClosing; StartMonitorUserOnlineState(); }
private void btnPatchUI_Click(object sender, EventArgs e) { var ui = (string)cbUI.SelectedItem; switch (ui) { case "XYWE": XYConfig.TurnXYWE(); break; case "YDWE": XYConfig.TurnYDWE(); break; default: throw new KeyNotFoundException("没有找到UI配置:" + ui); } MessageBox.Show("成功切换UI:" + ui); }