Example #1
0
        public static void Main(string[] args)
        {
            try
            {
                Console.Write ("How many employees do you want to generate? ");
                int count = int.Parse(Console.ReadLine());
                Console.WriteLine();

                // Create the collection and populate it.
                EmployeeCollection ec = new EmployeeCollection();
                ec.CreateEmployeeList(count);

                // TODO: Create the delegate used to sort by name.

                // TODO: Sort the list based on the name of the employee. To
                //       do this, call PerformEmployee Maintenance().

                Console.WriteLine ();

                // TODO: Create the delegate used to sort by I.D.

                // TODO: Sort the list based on the name of the employee.
            }
            catch (Exception e)
            {
                Console.WriteLine ("\n\n{0}", e.Message);
            }
            finally
            {
                Console.Write ("\n\nPress <ENTER> to end: ");
                Console.ReadLine();
            }
        }
Example #2
0
        // TODO: Complete this method by first calling Sort and then calling PrintEmployees.
        private static void PerformEmployeeMaintenance(EmployeeCollection ec, EmployeeCollection.CompareItemsCallback callBack, string title)
        {
            // Sort the list.
            ec.Sort(callBack);

            // Print the list.
            ec.PrintEmployees(title);
        }
Example #3
0
 // TODO: Complete this method by first calling Sort and then calling PrintEmployees.
 private static void PerformEmployeeMaintenance(EmployeeCollection ec, EmployeeCollection.CompareItemsCallback callBack, string title)
 {
 }