Пример #1
0
 private void doWhenMSGready(string msgToPass, eQuery msgType)
 {
     if (msgNotifier != null)
     {
         msgNotifier(msgToPass, msgType);
     }
 }
Пример #2
0
        public void remindLunch(object source, ElapsedEventArgs e)
        {
            string message = "It's time to eat !";

            mainTimer.Stop();
            eQuery query = eQuery.lunchTime;

            doWhenMSGready(message, query);
        }
Пример #3
0
        public void receiveAnswer(eQuery msgType, bool userAnswerToMSG)
        {
            int change = 10;

            if (userAnswerToMSG == true)
            {
                if (msgType == eQuery.mental)
                {
                    mentalAnswersYes++;
                    changeMentalScale(change);
                }
                else if (msgType == eQuery.phy)
                {
                    physicalAnswerYes++;
                    changePhysicalScale(change);
                }
                else
                {
                    if (msgType == eQuery.lunchTime)
                    {
                        change = 20;
                    }

                    changeMentalScale(change);
                    changePhysicalScale(change);
                }

                onBreak = true;
                mainTimer.Stop();
                decreaseTimer.Stop();
                updateScales(physicalScale, mentalScale);
            }
            else
            {
                if (msgType == eQuery.mental)
                {
                    mentalAnswerNo++;
                }
                else if (msgType == eQuery.phy)
                {
                    physicalAnswerNo++;
                }
            }
        }