public FillingCupProgressBarControl()
 {
     InitializeComponent();
     groupBox1.Text            = ResourceLoadHelper.GetLocalString("Queue");
     fillingCupIndicator.Value = 0;
     _fillColor = fillingCupIndicator.ForeColor;
     if (fillingCupIndicator.SkinImage == null)
     {
         if ((fillingCupIndicator.SkinImage = ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.None))) == null)
         {
             fillingCupIndicator.SkinExceptRectangleForProgressBar = new Rectangle(15, 36, 52, 105);
         }
         else
         {
             fillingCupIndicator.SkinExceptRectangleForProgressBar = fillingCupIndicator.DisplayRectangle;
         }
     }
     queueImages.Images.Add(ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty));
     queueImages.Images.Add(ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.Tea)) ?? ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty));
     queueImages.Images.Add(ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.Coffee)) ?? ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty));
     queueImages.Images.Add(ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.Juice)) ?? ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty));
     _flashingCup.NextOperation   += NextOperation;
     _flashingCup.FillCupComplete += FillCupComplete;
     _flashingCup.HideCup         += HideCup;
     _flashingCup.ShowCup         += ShowCup;
     _flashingCup.FillCupProgress += FillCupProgress;
 }
Пример #2
0
 public CashButtonControl()
 {
     InitializeComponent();
     groupBox1.Text    = ResourceLoadHelper.GetLocalString("PayGroup");
     label1.Text       = ResourceLoadHelper.GetLocalString("PayCurrency");
     changeButton.Text = ResourceLoadHelper.GetLocalString("Change");
 }
Пример #3
0
 public void RefreshGoods(Dictionary <Guid, Product> drinks)
 {
     descriptionToolTips.RemoveAll();
     if (drinks.Any() && (_buttons == null))
     {
         _buttons = drinks.Values.ToDictionary(x => x.id, y => new Button()
         {
             Size = new Size(94, 94), Font = new Font(Font, FontStyle.Bold), TextAlign = ContentAlignment.TopRight, ForeColor = y.parsedColor.R + y.parsedColor.G + y.parsedColor.B > 381 ? Color.Black : Color.White, BackColor = y.parsedColor, BackgroundImageLayout = ImageLayout.Stretch, BackgroundImage = y.type == DrinkType.None ? null : ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(y.type))
         });
         foreach (KeyValuePair <Guid, Button> btn in _buttons)
         {
             _goodsButtonHandlers.Add(btn.Key, (s, e) => { if (Purchase != null)
                                                           {
                                                               Purchase(btn.Key);
                                                           }
                                      });
             btn.Value.Click += _goodsButtonHandlers[btn.Key];
         }
         flowLayoutPanel1.Controls.AddRange(_buttons.Values.ToArray());
     }
     else
     {
         if (_buttons == null)
         {
             return;
         }
         List <Guid> delete = _buttons.Keys.Except(drinks.Keys).ToList();
         foreach (Guid guid in delete)
         {
             _buttons[guid].Click -= _goodsButtonHandlers[guid];
             flowLayoutPanel1.Controls.Remove(_buttons[guid]);
             _buttons.Remove(guid);
         }
     }
     if (_buttons.Any())
     {
         foreach (Product drink in drinks.Values)
         {
             _buttons[drink.id].Text = drink.quantity.ToString();
             descriptionToolTips.SetToolTip(_buttons[drink.id], string.Format(ResourceLoadHelper.GetLocalString("GoodsDescription"), ResourceLoadHelper.GetLocalName(drink.locals), drink.price, drink.quantity));
         }
     }
 }
Пример #4
0
 public void InsufficientMessage()
 {
     timer1.Stop();
     display.Text = ResourceLoadHelper.GetLocalString("InsufficientMessage");
     timer1.Start();
 }
Пример #5
0
 public void ThanksMessage()
 {
     timer1.Stop();
     display.Text = ResourceLoadHelper.GetLocalString("ThanksMessage");
     timer1.Start();
 }
Пример #6
0
 public GoodsButtonControl()
 {
     InitializeComponent();
     groupBox1.Text = ResourceLoadHelper.GetLocalString("DrinksGroup");
 }