private void Drink_MouseDown(object sender, MouseButtonEventArgs e) { Americano a = (Americano)sender; if (mtn) { Settigns form = new Settigns(); form.price.Text = a.Price.ToString(); form.name.Text = a.NameCoffee; form.pic.Source = a.Drink; form.type.Text = a.Type.ToString(); form.cc.Color = a.ColorChoice; form.Avl.IsChecked = a.Ready; form.ShowDialog(); a.Price = double.Parse(form.price.Text); a.NameCoffee = form.name.Text; a.Drink = form.pic.Source; a.Type = (TypeC)Enum.Parse(typeof(TypeC), form.type.Text); a.ColorChoice = form.cc.Color; a.Ready = (bool)form.Avl.IsChecked; return; } GoDisable(); a.Acitve = !a.Acitve; if (DrinkChosen != null) { DrinkChosen(sender, EventArgs.Empty); } }
public void GoDisable() { foreach (var item in FindVisualChildren <Americano>(uc)) { if ((string)item.Tag == "t") { Americano a = (Americano)item; a.Acitve = false; } } }
private void ChoiceEvt(object sender, EventArgs e) { chosen = (Americano)sender; if (!chosen.Ready) { chosen.Acitve = false; return; } Choice.Content = "Напиток:\n" + chosen.NameCoffee; mainc.Asked = chosen.Price; mainc.Type = chosen.Type; if (mainc.Type == TypeC.Other) { SugarLock(true); } else if (sugarlocked) { SugarLock(false); Sugar.Content = "Сахар: "; } FullFill(); }
public Other() { drk = null; this.CupColor = Colors.White; }
public Other(string name, Americano c, Color col) { this.name = name; drk = c; this.CupColor = col; }
public void GoAtIt(Americano oth, Color cup) { othercolor = oth.ColorChoice; GoAtIt(false, 0, cup); }