private void OpenBtn_Click(object sender, System.EventArgs e) { switch (Index.TestMode) { case TestType.StartWithWaitGeneric: FormUnifier.StartWithWait <A>(() => Thread.Sleep(2000)); break; case TestType.StartWithWait: FormUnifier.StartWithWait(() => { Thread.Sleep(2000); return(FormUnifierResult.Create <A>()); }, "Waiting for A..."); break; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FormUnifier.Init <Parent, Wait>(); switch (TestMode) { case TestType.StartWithWaitGeneric: FormUnifier.StartWithWait <A>(() => Thread.Sleep(2000), null, new FormUnifierParams("Starting...")); break; case TestType.StartWithWait: FormUnifier.StartWithWait(() => { Thread.Sleep(2000); return(FormUnifierResult.Create <A>()); }, "Starting..."); break; } Application.Run(FormUnifier.Container); }