Beispiel #1
0
        private static void InitiateClosingSequence()
        {
            // This is equivalent to 20 seconds
            var timeSpan = new TimeSpan(0, 0, 5);

            AppTerminator.CloseAfterElapsedTime(timeSpan, true);
            AppTerminator.CloseApplication(true);
        }
        private static void Main()
        {
            Console.Title = Assembly.GetExecutingAssembly().GetName().Name;

            var scriptsToLoad = GrabScriptsToLoad();

            var scriptIDs = OpenScripts(scriptsToLoad);
            var process   = LaunchGame();

            Write("This application, if left open, will end all scripts that were started once you close the game.");
            Write();

            if (!process.HasExited)
            {
                process.WaitForExit();
            }

            CloseScripts(scriptIDs);

            LaunchBackupCreator();

            AppTerminator.CloseAfterElapsedTime(TimeSpan.FromSeconds(10), true);
            AppTerminator.CloseApplication(true);
        }