private void NewStepAdd_Click(object sender, EventArgs e) { RecipeStep step = new RecipeStep(this.NewStepText.Text); NewRecipe.AddRecipeStep(step); this.RecipeStepsList.DataSource = null; this.RecipeStepsList.DataSource = NewRecipe.RecipeSteps.RecipeSteps; }
public int AddRecipeStep(RecipeStep step) { return RecipeSteps.AddRecipeStep(step); }
/* * Return new index of successfully added recipe step. -1 if unsuccessful. */ public int AddRecipeStep(RecipeStep newRecipeStep) { RecipeSteps.Add(newRecipeStep); return RecipeSteps.Count; }