public static Form RunSpecificDemo(LayoutFarm.App demo, LayoutFarm.AppHost appHost, InnerViewportKind innerViewportKind = InnerViewportKind.GdiPlusOnGLES) { System.Drawing.Rectangle workingArea = Screen.PrimaryScreen.WorkingArea; Form formCanvas = LayoutFarm.UI.FormCanvasHelper.CreateNewFormCanvas( workingArea.Width, workingArea.Height, innerViewportKind, out GraphicsViewRoot viewroot); #if DEBUG formCanvas.Text = innerViewportKind.ToString(); #endif formCanvas.FormClosed += (s, e) => { demo.OnClosing(); demo.OnClosed(); }; LayoutFarm.AppHostConfig config = new LayoutFarm.AppHostConfig(); YourImplementation.UISurfaceViewportSetupHelper.SetUISurfaceViewportControl(config, viewroot); appHost.Setup(config); appHost.StartApp(demo); // //viewroot.TopDownRecalculateContent(); //================================================== viewroot.PaintToOutputWindow(); //formCanvas.WindowState = FormWindowState.Maximized; formCanvas.Show(); #if DEBUG if (dbugShowLayoutInspectorForm) { LayoutInspectorUtils.ShowFormLayoutInspector(viewroot); } #endif //Application.Run(formCanvas); formCanvas.Show(); return(formCanvas); }
public static Form RunSpecificDemo(LayoutFarm.App demo, LayoutFarm.AppHostWinForm appHost, InnerViewportKind innerViewportKind = InnerViewportKind.GdiPlusOnGLES) { System.Drawing.Rectangle workingArea = Screen.PrimaryScreen.WorkingArea; Form formCanvas = FormCanvasHelper.CreateNewFormCanvas( workingArea.Width, workingArea.Height, innerViewportKind, out UISurfaceViewportControl latestviewport); #if DEBUG formCanvas.Text = innerViewportKind.ToString(); #endif formCanvas.FormClosed += (s, e) => { demo.OnClosing(); demo.OnClosed(); }; appHost.SetUISurfaceViewportControl(latestviewport); appHost.StartApp(demo); // latestviewport.TopDownRecalculateContent(); //================================================== latestviewport.PaintMe(); //formCanvas.WindowState = FormWindowState.Maximized; formCanvas.Show(); #if DEBUG if (dbugShowLayoutInspectorForm) { LayoutInspectorUtils.ShowFormLayoutInspector(latestviewport); } #endif //Application.Run(formCanvas); formCanvas.Show(); return(formCanvas); }