コード例 #1
0
        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();
 }