Exemple #1
0
 public uiPantry(
     Action launchAddIngredientDelegate,
     MyPantry pantry)
 {
     _pantry = pantry;
     _launchAddIngredientDelegate = launchAddIngredientDelegate;
     InitializeComponent();
     pantryItemBindingSource.DataSource   = _pantry.IngredientList;
     uxPantryItemsDataGridView.DataSource = pantryItemBindingSource;
 }
Exemple #2
0
        public HomeController()
        {
            _query = new Query();
            DataGenerator.DataGenerator.GenerateAndInsertData(_query, 20, 10, 50);

            _recipeInventory   = new RecipeInventory(_query);
            _shoppingInventory = new ShoppingListInventory(_query);
            _pantry            = new MyPantry(_query);

            _recipeController       = new RecipeController(_recipeInventory, _pantry);
            _pantryController       = new PantryController(_pantry);
            _shoppingListController = new ShoppingListController(_shoppingInventory, _pantry, _recipeInventory);
            _statsFormController    = new StatsFormController(_query);

            _launchRecipeManager       = _recipeController.LaunchRecipeForm;
            _launchPantryManager       = _pantryController.LaunchPantryForm;
            _launchShoppingListManager = _shoppingListController.LaunchShoppingListForm;
            _launchStatsFormManager    = _statsFormController.LaunchStatsForm;
        }