示例#1
0
        private void lstIngrediënten_DoubleClick(object sender, EventArgs e)
        {
            AddIngrediënt editIngrediënt = new AddIngrediënt(ingrediënten[lstIngrediënten.SelectedIndex]);

            if (editIngrediënt.ShowDialog() == DialogResult.OK)
            {
                ingrediënten[lstIngrediënten.SelectedIndex] = editIngrediënt.Ingrediënt;
            }
        }
示例#2
0
        private void btnAddIngrediënt_Click(object sender, EventArgs e)
        {
            AddIngrediënt addIngrediënt = new AddIngrediënt(new IngrediëntEenheid());

            if (addIngrediënt.ShowDialog() == DialogResult.OK)
            {
                if (ingrediënten.Contains(addIngrediënt.Ingrediënt))
                {
                    ingrediënten.Remove(addIngrediënt.Ingrediënt);
                }

                ingrediënten.Add(addIngrediënt.Ingrediënt);
            }
        }