コード例 #1
0
        public bool AddNewParticipant(Participant e)
        {
            if (participants == null || participants.Contains(e))
            {
                return(false);
            }

            //increase count of Participants
            ParticipantsCount++;
            int tmpX = (int)Math.Ceiling((double)ParticipantsCount / GroupSize);

            //if count of groups changed then add new empty Group
            // TODO improve by ensuring that the number of groups is correct afterwards
            if (tmpX != X)
            {
                X = tmpX;
                Cohort.AddEmptyGroup();
            }

            //add the new participant to entries
            participants.Add(e);
            //add the new participant to the set of not yet matched entries
            NMP.Add(e);
            return(true);
        }
コード例 #2
0
 private void Reset_Click(object sender, RoutedEventArgs e)
 {
     NTBox.Clear();
     NUP.Clear();
     NMP.Clear();
     CIU.Clear();
     CIM.Clear();
     DF.Clear();
     MIT.Clear();
     PIM.Clear();
     isMasked.IsChecked = false;
     Result.Items.Clear();
 }
コード例 #3
0
        public bool RemoveParticipant(Participant e)
        {
            if (participants == null || !participants.Contains(e))
            {
                return(false);
            }

            //increase count of Participants
            ParticipantsCount--;
            int tmpX = (int)Math.Ceiling((double)ParticipantsCount / GroupSize);

            Cohort.Remove(e);

            //remove a participant to all Entries
            participants.Remove(e);
            //remove a participant to the set of not yet Matched
            if (NMP.Contains(e))
            {
                NMP.Remove(e);
            }
            return(true);
        }