Esempio n. 1
0
        static void SortAndPrint(
            ArrayList pl, IComparer pc)
        {
            Console.WriteLine(
                "----- Sorted by: {0}",
                Contact.Names[Contact.SortBy]);
            pl.Sort(pc);
            int n = 0;

            foreach (string str in Contact.Names)
            {
                Console.Write(
                    Contact.Fmt(n++), str);
            }
            Console.WriteLine();
            foreach (Contact c in pl)
            {
                for (int i = 0; i < c.Length; i++)
                {
                    string str = c[i];
                    Console.Write(
                        Contact.Fmt(i), (str.Length > 0
                         ? str : " "));
                }
                Console.WriteLine();
            }
        }