Beispiel #1
0
        private static void Exit(string message = null, int code = 0)
        {
            if (message != null)
            {
                if (code == 0)
                {
                    Log.Info(message);
                }
                else
                {
                    Log.Error(message);
                }
            }

            if (!Settings.Silent)
            {
                // If the Debugger is Attached or there was an error
                // make sure the user has time to read the messages.
                if (Debugger.IsAttached || code != 0)
                {
                    Console.WriteLine(@"Press enter to continue...");
                    Console.ReadLine();
                }
            }
            else
            {
                // Restore the Console so we don't strand a window in the background.
                WindowsInterop.ShowConsole();
            }

            Environment.Exit(code);
        }
Beispiel #2
0
        /// <summary>
        /// Process the incoming arguments
        /// </summary>
        private static void ProcessArguments(Dictionary <string, string> arguments)
        {
            // Load Settings
            Settings.LoadFromArguments(arguments);

            // Silent mode will hide the console window.
            if (Settings.Silent)
            {
                WindowsInterop.HideConsole();
                Log.Info("Running Silent");
            }



            // Log Current Settings
            Settings.LogCurrentValues();
        }