Пример #1
0
 public Dish(string name, IngredientList ingredients)
 {
     Name        = name;
     Ingredients = ingredients;
     ingredients.PropertyChanged += Ingredients_PropertyChanged;
     UpdateInfo();
 }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();
            Menu = new DishList();
            Menu.FillList();
            dishGrid.DataContext       = Menu;
            ingredientGrid.DataContext = Ingredients;

            var ingredients = new ObservableCollection <Ingredient>()
            {
                new DairyProduct("Cow milk", 0.6f, DairyProduct.Group.Milk, 250),
                new DairyProduct("Vanilla ice cream", 2.01f, DairyProduct.Group.IceCream, 100),
                new Fruit("Banana", 0.89f, "Yellow", 0.12f, 150),
                new Vegetable("Tomato", 0.3f, Vegetable.PungencyDegree.None, "Red", 150),
                new Meat("Chiken", 1f, Meat.MeatType.Chicken, 100),
                new Meat("Beef", 1f, Meat.MeatType.Beef, 100)
            };

            FullList = new IngredientList(ingredients);
            pluginCheckBox.DataContext = this;
            fullListGrid.ItemsSource   = FullList.Ingredients;
            FillPluginList();
        }
Пример #3
0
 public void RefreshIngredientGrid(DataGrid grid, IngredientList list)
 {
     grid.DataContext = typeof(IngredientList);
     grid.DataContext = list;
 }
Пример #4
0
 public Drinks(string name, IngredientList ingredients, TemperatureType degree) : base(name, ingredients)
 {
     Temperature = degree;
 }
Пример #5
0
 public Dish()
 {
     Ingredients = new IngredientList();
     Ingredients.PropertyChanged += Ingredients_PropertyChanged;
     Name = "New dish";
 }
Пример #6
0
 public Snacks(string name, IngredientList ingredients, Snack type, Drinks drink) : base(name, ingredients)
 {
     SnackType  = type;
     ServedWith = drink;
 }
Пример #7
0
 public MainCourse(string name, IngredientList ingredients, bool vegetarian, MealType meal) : base(name, ingredients)
 {
     Meal       = meal;
     Vegeterian = vegetarian;
 }