Пример #1
0
        static void Main(string[] args)
        {
            var scenarios = ScenarioRunner.FindScenarios(typeof(Scenarios));

            while (true)
            {
                Console.WriteLine("\nSelect scenario to run: ");
                for (var index = 0; index < scenarios.Length; index++)
                {
                    Console.WriteLine($"{index}: {scenarios[index].Name}");
                }
                Console.Write("> ");

                var  selection = Console.ReadLine();
                uint selectedScenarioIndex;
                if (uint.TryParse(selection, out selectedScenarioIndex) && selectedScenarioIndex < scenarios.Length)
                {
                    scenarios[selectedScenarioIndex].RunScenarioAsync().Wait();
                }
            }
        }
Пример #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     comboBox.Items.Clear();
     comboBox.Items.AddRange(ScenarioRunner.FindScenarios(typeof(Scenarios)));
     comboBox.SelectedIndex = 0;
 }