示例#1
0
        static void Main(string[] args)
        {
            StudentClass stu = new StudentClass();

            stu.Name = "arron";
            List <StudentClass> students = new List <StudentClass>();

            students.Add(stu);
            FindName myName = new FindName("arron");

            students.Add(new StudentClass("candy"));

            foreach (var student in students.FindAll(new Predicate <StudentClass>(myName.IsName)))
            {
                Console.WriteLine(student);
            }
        }
示例#2
0
 public bool IsName(StudentClass s)
 {
     return((s.Name == _name) ? true : false);
 }