Пример #1
0
        static void Main(string[] args)
        {
            Delegate dele = new Delegate();

            Comparer cmpf = new Comparer(Delegate.CompareFirstNames);

            Comparer cmpl = new Comparer(Delegate.CompareLastNames);

            Console.WriteLine("\n Before Sort: \n");

            dele.PrintNames();

            dele.Sort(cmpf);

            Console.WriteLine("\n After CompareFirstNames Sort: \n");

            dele.PrintNames();

            dele.Sort(cmpl);

            Console.WriteLine("\n After CompareLastNames Sort: \n");

            dele.PrintNames();

            Console.ReadLine();
        }