mattercontrol/Launcher/Launcher.cs

34 lines
660 B
C#
Raw Normal View History

using System;
using System.Diagnostics;
2015-04-08 15:20:10 -07:00
using System.IO;
namespace MatterHackers.MatterControl.Launcher
{
2015-04-08 15:20:10 -07:00
public class LauncherApp
{
public LauncherApp()
{
}
2015-04-08 15:20:10 -07:00
[STAThread]
public static void Main(string[] args)
{
if (args.Length == 2 && File.Exists(args[0]))
{
ProcessStartInfo runAppLauncherStartInfo = new ProcessStartInfo();
runAppLauncherStartInfo.FileName = args[0];
2015-04-08 15:20:10 -07:00
int timeToWait = 0;
int.TryParse(args[1], out timeToWait);
2015-04-08 15:20:10 -07:00
Stopwatch waitTime = new Stopwatch();
waitTime.Start();
while (waitTime.ElapsedMilliseconds < timeToWait)
{
}
2015-04-08 15:20:10 -07:00
Process.Start(runAppLauncherStartInfo);
}
}
}
}