protected override void OnLoad(EventArgs e)
        {
            var recipeTypes = RecipeLoader.GetRecipeTypes();

            listBox1.DataSource    = recipeTypes;
            listBox1.DisplayMember = "Name";
        }
Exemple #2
0
        public void Run()
        {
            var recipeTypes = RecipeLoader.GetRecipeTypes();

            if (!recipeTypes.Any())
            {
                Console.WriteLine("No recipes have been added to the project");
                return;
            }

            Console.WriteLine("Choose a recipe:");

            int choosenRecipe = 0;

            while (choosenRecipe == 0)
            {
                for (int i = 1; i <= recipeTypes.Count; i++)
                {
                    var recipeType = recipeTypes[i - 1];
                    Console.WriteLine(i + ". " + recipeType.Name);
                }
                if (!int.TryParse(Console.ReadLine(), out choosenRecipe))
                {
                    choosenRecipe = 0;
                }
            }

            var choosenRecipeType = recipeTypes[choosenRecipe - 1];

            RecipeLoader.RunRecipe(choosenRecipeType.Type, new NullLogger());
        }
Exemple #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Text = _recipeType.Name;
            Console.SetOut(new ControlWriter(textBox1));
            Console.SetError(new ControlWriter(textBox1));
            var thread = new Thread(() => RecipeLoader.RunRecipe(_recipeType.Type, this));

            thread.Start();
        }