private static void Buttons_OnButtonDetect(ButtonEventArgs e)
 {
     if (settings.isClosed == 0)
     {
         if (e.BUTTONINVOKED && card.Role == CardRole.Credit || card.Role == CardRole.Debet)
         {
             DISPENSING = true;
         }
         else if (e.BUTTONINVOKED && card.Role != CardRole.Credit && card.Role != CardRole.Debet && MENUSHOWED)
         {
             menu.Pointer(position.Volume, position.Position);
             position.Clear();
         }
         else
         {
             position.Clear();
         }
     }
 }
        private static void Buttons_OnButtonDetect(ButtonEventArgs e)
        {
            if (settings.isClosed == 0)
            {
                if (e.BUTTONINVOKED && card.Role == CardRole.Credit || card.Role == CardRole.Debet)
                {
                    DISPENSING = true;
                }
                else if (e.BUTTONINVOKED && card.Role != CardRole.Credit && card.Role != CardRole.Debet && MENUSHOWED)
                {
                    menu.Pointer(position.Volume, position.Position);
                    position.Clear();
                }
                else if (e.BUTTONINVOKED && card.Role == CardRole.OnOff)
                {
                    if (position.Volume == Choice.small && ONOFFMODE == 0)
                    {
                        Buttons.VentilsOnOff(position.Position, STATE.On);
                        ONOFFMODE = position.Position;
                    }
                    else if (position.Volume == Choice.large && position.Position == ONOFFMODE)
                    {
                        Buttons.VentilsOnOff(position.Position, STATE.Off);
                        ONOFFMODE = 0;
                    }

                    position.Clear();
                }
                else
                {
                    position.Clear();
                }
            }

        }