コード例 #1
0
 private void PrintStudents(Dictionary <string, double> sortedStudents)
 {
     foreach (var item in sortedStudents)
     {
         StudentsRepository studentsRepository = new StudentsRepository(new RepositoryFilter(), new RepositorySorters());
         studentsRepository.PrintStudent(item);
     }
 }
コード例 #2
0
        private void FilterAndTake(Dictionary <string, double> sudentsWithMarks, Predicate <double> givenFilter, int studentsToTake)
        {
            int counterForPrinted = 0;

            foreach (var userName_Points in sudentsWithMarks)
            {
                if (counterForPrinted == studentsToTake)
                {
                    break;
                }

                if (givenFilter(userName_Points.Value))
                {
                    StudentsRepository studentsRepository = new StudentsRepository(new RepositoryFilter(), new RepositorySorters());
                    studentsRepository.PrintStudent(userName_Points);
                    counterForPrinted++;
                }
            }
        }