Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var student = new Student();

            student.studentList.Add(new Student()
            {
                Id = 1, Name = "hina", Grade = 20
            });
            student.studentList.Add(new Student()
            {
                Id = 2, Name = "zoya", Grade = 50
            });
            student.studentList.Add(new Student()
            {
                Id = 3, Name = "mona", Grade = 67
            });
            student.studentList.Add(new Student()
            {
                Id = 4, Name = "lola", Grade = 12
            });

            MutliCastDelegate del;

            del  = new MutliCastDelegate(student.SaySomething);
            del += student.StudentId;
            del(student.studentList);

            var isPassed = new IsPassed(Passed);

            student.CkeckDuplictes(student.studentList, isPassed);
            Console.ReadLine();
        }
Exemplo n.º 2
0
 public static void resultStudent(List<Student> listStudent, IsPassed delPassed)
 {
     foreach (Student stu in listStudent)
     {
         if (delPassed(stu))
         {
             Console.WriteLine("Congratulation !!! {0} you are Passed!", stu.SName);
         }
     }
 }
Exemplo n.º 3
0
 public static void resultStudent(List <Student> listStudent, IsPassed delPassed)
 {
     foreach (Student stu in listStudent)
     {
         if (delPassed(stu))
         {
             Console.WriteLine("Congratulation !!! {0} you are Passed!", stu.SName);
         }
     }
 }
Exemplo n.º 4
0
 public void  CkeckDuplictes(List <Student> studentList, IsPassed passed)
 {
     foreach (var student in studentList)
     {
         if (passed(student))
         {
             Console.WriteLine("{0} has cleared", student.Name);
         }
     }
 }
Exemplo n.º 5
0
 public override int GetHashCode()
 {
     return(Person.GetHashCode() + IsPassed.GetHashCode() + CountPassed.GetHashCode() + CountTickets.GetHashCode());
 }