Ejemplo n.º 1
0
 public RecipeForm(ObjectStorage storage, Recipe recipe) : this(storage)
 {
     txtDescription.Text  = recipe.Description;
     SelectedGroup        = recipe.Group;
     _ingredient          = recipe.Ingredients;
     _ingredient.Changed += ingredient_Changed;
     ingredient_Changed(this, new EventArgs());
     txtSteps.Text = recipe.RecipeSteps;
 }
Ejemplo n.º 2
0
        public RecipeForm(ObjectStorage storage)
        {
            _storage = storage;
            InitializeComponent();
            groupListCmb();

            _ingredient          = new IngredientContainer();
            _ingredient.Changed += ingredient_Changed;
        }
Ejemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();

            _storage = ObjectStorage.GetInstance();

            _storage.GetRecipe().Changed     += RecipeContainer_Changed;
            _storage.GetIngredient().Changed += IngredientContainer_Changed;
            _storage.GetIngredient().Changed += RecipeContainer_Changed;
            _storage.GetGroups().Changed     += GroupContainer_Changed;
            _storage.GetGroups().Changed     += RecipeContainer_Changed;

            mainListView.ItemSelectionChanged += mainListView_ItemSelectionChanged;
            lvIngredient.ItemSelectionChanged += lvIngredient_ItemSelectionChanged;
            lvGroup.ItemSelectionChanged      += lvGroup_ItemSelectionChanged;

            RecipeContainer_Changed(this, new EventArgs());
            IngredientContainer_Changed(this, new EventArgs());
            GroupContainer_Changed(this, new EventArgs());
        }