Exemple #1
0
        private static void Menu()
        {
            _activityFacade = new ActivityFacade();
            var activity = _activityFacade.GenerateActivity(ActivityType.Reading);

            VelocityRequired velocityRequired;
            string           option = "D";

            do
            {
                switch (option)
                {
                case "S":
                    LoadData(activity);
                    _activityFacade.RunCalculateActivity(activity);
                    DisplayOnScreen(activity);
                    break;

                case "E":
                    break;

                case "C":
                    Console.Clear();
                    ShowMenu();
                    break;

                case "L":
                    _activityFacade.RunCalculateActivity(activity);
                    DisplayOnScreen(activity);
                    break;

                case "R":
                    // ShowDisplayActivities();
                    // testingRunningReadingActivity.Run(activityProcessor, new ReadingActivity());

                    /*ProcessStartInfo psi = new ProcessStartInfo("cmd.exe")
                     * {
                     *  RedirectStandardError = true,
                     *  RedirectStandardInput = true,
                     *  RedirectStandardOutput = true,
                     *  UseShellExecute = false,
                     *  Arguments = @"F:\LocalRepositories\FHF.CalculatingReadVelocity\FHF.CoreComponent.ConsoleApp\bin\Debug\netcoreapp2.1\"
                     * };
                     *
                     * Process p = Process.Start(psi);
                     * StreamWriter sw = p.StandardInput;
                     * StreamReader sr = p.StandardOutput;
                     *
                     * sw.WriteLine("Hello world!");
                     * sr.Close();*/

                    ProcessStartInfo psi1 = new ProcessStartInfo();

                    psi1.UseShellExecute = false;
                    psi1.Arguments       = @"F:\LocalRepositories\FHF.CalculatingReadVelocity\FHF.CoreComponent.ConsoleApp\bin\Debug\netcoreapp2.1\FHF.CoreComponent.ConsoleApp.exe";
                    psi1.FileName        = "FHF.CoreComponent.ConsoleApp.exe";
                    Process p1 = Process.Start(psi1);


                    // psi1.Arguments = "/K yourmainprocess.exe";
                    p1.WaitForExit();

                    break;

                default:
                    ShowMenu();
                    break;
                }
                option = Console.ReadLine().ToUpper();
            } while (option != "E");
        }