Exemplo n.º 1
0
        public void ShuffleList(List <Petition> list)
        {
            Random random = new Random();

            if (list.Count > 1)
            {
                for (int i = list.Count - 1; i >= 0; i--)
                {
                    Petition tmp         = list[i];
                    int      randomIndex = random.Next(i + 1);

                    //Swap elements
                    list[i]           = list[randomIndex];
                    list[randomIndex] = tmp;
                }
            }
        }
Exemplo n.º 2
0
 public void ApplyPetition(Petition petition)
 {
     ReceivedPetitions.Add(petition);
 }