예제 #1
0
        private void Ingredients_Click(object sender, EventArgs e)
        {
            if (MasterContext == null)
            {
                MasterContext = GetMasterContext();
            }
            ManagerWindow mw = ManagerWindow.GetIngredientManager(MasterContext);

            mw.MyParent = this;
            mw.Show();
            Hide();
        }
예제 #2
0
        public static ManagerWindow GetIngredientManager(IMealPlannerContext db)
        {
            ManagerWindow mw = new ManagerWindow()
            {
                Text = "Ingredient Manager",
                db   = db,
                ListBoxDataSource = db.GetIngredients()
            };

            mw.AddClickMethod = mw.AddIngredientDelegate;
            return(mw);
        }