private int InternalStart(LaunchMode launchMode) { switch (launchMode) { case LaunchMode.CommandLine: return(ShellRunner.Start(_args)); case LaunchMode.Gui: Application selfTesterApplication = new SelfTesterApplication(); selfTesterApplication.MainWindow.Show(); Unmanaged.FreeConsole(); return(selfTesterApplication.Run()); default: throw new InvalidEnumArgumentException("launchMode", (int)launchMode, typeof(LaunchMode)); } }