コード例 #1
0
        private void LoadRecipe(Recipe recipe)
        {
            var categories = repository.GetCategories().ToList();

            _categoryIndex    = categories.FindIndex(c => c.Name == recipe.Category.Name) + 1;
            textBoxTitle.Text = recipe.Title;
            textBoxDesc.Text  = recipe.Description;
            textBoxIng.Text   = recipe.Ingredients;
            comboBoxCategory.SelectedIndex = _categoryIndex;
        }
コード例 #2
0
 public void LoadCategories()
 {
     recipeCategory = new BindingList <RecipeCategory>(repository.GetCategories().ToList());
     recipeCategory.Insert(0, new RecipeCategory {
         Name = ""
     });
     comboBoxCategory.DataSource    = recipeCategory;
     comboBoxCategory.DisplayMember = "Name";
 }