private void MessageReceived(DecodedShortMessage message)
        {
            var data = message.Data as SmsDeliverPdu;

            bool found = false;
            foreach (var participant in _quiz.Participants)
            {
                if (participant.PhoneNumber == data.OriginatingAddress)
                {
                    found = true;
                    participant.Name = Regex.Replace(data.UserDataText, "\\s+", " ");
                }
            }
            if (!found)
            {
                var participant = new Participant();
                participant.Name = Regex.Replace(data.UserDataText, "\\s+", " ");
                participant.PhoneNumber = data.OriginatingAddress;
                _quiz.Participants.Add(participant);
            }
        }
示例#2
0
 public ParticipantAnswer(Participant participant)
 {
     Participant = participant;
 }
示例#3
0
 public WinnerPage(Participant participant)
 {
     Winner = participant;
     InitializeComponent();
 }