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(); }
public FormXYWE() { if (!File.Exists(XYPath.File.UpdateLock) && File.Exists(XYPath.File.DataUpdateLog)) { var formLog = new FormUpdateLog(); formLog.ShowDialog(); } XYWeb.ReadXyweServerTextAsync("announcement/last.txt", lastAnnouncementId => { if (lastAnnouncementId == XYAnnouncement.GetLocalAnnouncementId()) { return; } XYAnnouncement.SetLocalAnnouncementId(lastAnnouncementId); XYWeb.ReadXyweServerTextAsync($"announcement/{lastAnnouncementId}.txt", announcement => { var formAnnouncement = new FormAnnouncement(announcement); formAnnouncement.ShowDialog(); }, null, null); }, null, null, 0); InitializeComponent(); XYFile.RemoveDirectory(XYPath.Dir.DataUpdate); if (!File.Exists(XYPath.File.UpdateLock)) { XYProcess.Application.StartXYChecker(); } }
void CompileEditor() { string pathEditorSourceRoot = $@"{XYPath.Dir.Root}\Develop-Editor"; string pathEditorSourceBuild = $@"{pathEditorSourceRoot}\Build"; string pathEditorSourcePublish = $@"{pathEditorSourceBuild}\publish\Release"; string pathEditorOutput = $@"{XYPath.Dir.Root}\core\editor"; Console.WriteLine("Start Compile ..."); var info = new ProcessStartInfo($@"{pathEditorSourceBuild}\Build_Release.bat"); info.WorkingDirectory = pathEditorSourceBuild; Process.Start(info).WaitForExit(); if (!Directory.Exists(pathEditorSourcePublish)) { Console.WriteLine("Compile failed, try re-select."); return; } Console.WriteLine("Compile success! Moving file ..."); XYFile.CopyDirectory(pathEditorSourcePublish, pathEditorOutput, true); Console.WriteLine("File move done!"); }