private void doWhenMSGready(string msgToPass, eQuery msgType) { if (msgNotifier != null) { msgNotifier(msgToPass, msgType); } }
public void remindLunch(object source, ElapsedEventArgs e) { string message = "It's time to eat !"; mainTimer.Stop(); eQuery query = eQuery.lunchTime; doWhenMSGready(message, query); }
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++; } } }