public void onProcessExit(ProcessPanel p, string path, string args, bool error) { if (error) { if (chkNoPeople.Checked) { p.StartProcess(); } else { MessageBox.Show("异常结束!\n" + path + " " + args); } } }
private void InitProcessPanel(CoreConfig config) { int width = this.layoutMain.Size.Width - 28; this.layoutMain.SuspendLayout(); this.layoutMain.Controls.Clear(); // List<StubApp> apps =new List<StubApp>(); if (config.Apps != null) { foreach (App app in config.Apps) { if (app.Disable) { continue; } app.Path = app.Path.Replace("${ServerPath}", config.ServerPath); if (app.HasStubApp) { foreach (StubApp a in app.Apps) { if (a.Disable) { continue; } // apps.Add(a); a.Path = app.Path; ProcessPanel p = new ProcessPanel(a, width); p.OnProcessExit = onProcessExit; ProcessPanels.Add(p); this.layoutMain.Controls.Add(p); } } else { //apps.Add(app); ProcessPanel p = new ProcessPanel(app, width); p.OnProcessExit = onProcessExit; ProcessPanels.Add(p); this.layoutMain.Controls.Add(p); } } } this.layoutMain.ResumeLayout(); }