コード例 #1
0
ファイル: MainForm.cs プロジェクト: ashllay/LQGMTool
 public void onProcessExit(ProcessPanel p, string path, string args, bool error)
 {
     if (error)
     {
         if (chkNoPeople.Checked)
         {
             p.StartProcess();
         }
         else
         {
             MessageBox.Show("异常结束!\n" + path + " " + args);
         }
     }
 }
コード例 #2
0
        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();
        }