Пример #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;
                }
            }
        }
Пример #2
0
 public void ApplyPetition(Petition petition)
 {
     ReceivedPetitions.Add(petition);
 }