예제 #1
0
파일: Program.cs 프로젝트: agabani/clowning
        private static bool Run(ConsoleDisplay consoleDisplay, OptionsExecuter optionsExecuter)
        {
            var options   = new Options();
            var userInput = Console.ReadLine();

            if (string.IsNullOrWhiteSpace(userInput))
            {
                consoleDisplay.DisplayUsage(options);
            }
            else
            {
                var arguments = userInput.Split(' ');

                if (CommandLine.Parser.Default.ParseArguments(arguments, options))
                {
                    return(optionsExecuter.Execute(options));
                }
            }
            return(true);
        }
예제 #2
0
파일: Program.cs 프로젝트: agabani/clowning
        private static void Main(string[] args)
        {
            var client          = new BlyncClient();
            var optionsExecuter = new OptionsExecuter(client);
            var consoleDisplay  = new ConsoleDisplay();

            Console.WriteLine("Blync stand alone console");

            if (client.NumberOfDevices <= 0)
            {
                consoleDisplay.DisplayDeviceNotFoundError();
                return;
            }

            consoleDisplay.DisplayConnectedDevices(client);

            bool keepAlive;

            do
            {
                keepAlive = Run(consoleDisplay, optionsExecuter);
            } while (keepAlive);
        }