Esempio n. 1
0
        // Private input handler for console commands.
        private static bool HandleConsoleInput(IWindowsService service, string line)
        {
            bool canContinue = true;

            // check input
            if (line != null)
            {
                switch (line.ToUpper())
                {
                case "Q":
                    canContinue = false;
                    break;

                case "P":
                    service.OnPause();
                    break;

                case "R":
                    service.OnContinue();
                    break;

                default:
                    service.OnCustomCommand(int.Parse(line));
                    break;
                }
            }

            return(canContinue);
        }