Beispiel #1
0
 public static void getAge(List <Student> list, AgeDelegate t)
 {
     foreach (Student item in list)
     {
         if (t(item))
         {
             Console.WriteLine(item);
         }
     }
 }
Beispiel #2
0
 static IEnumerable <MyObject> AgeCheck(List <MyObject> people, AgeDelegate checkAge)
 {
     foreach (MyObject person in people)
     {
         if (checkAge(person.Age))
         {
             yield return(person);
         }
     }
 }
Beispiel #3
0
        //A method that take your age and do some logics with it return the result
        static bool AgeLogicResult(float age, AgeDelegate AgeLogic)
        {
            bool isResult = AgeLogic(age);

            return(isResult);
        }