Пример #1
0
        //Sorts tasks by TODO, DOING, DONE and displays in console
        private void SortByList()
        {
            List <string> sortOptionsMenu = AddEnumItems.CreateUpperCase(typeof(sortMenuItems));
            int           returnIndex     = DisplayMenu(sortOptionsMenu, "Sort Menu");

            switch (returnIndex)
            {
            case (int)sortMenuItems.Todo:
                foreach (Task task in todoHandler.GetTasks(TodoHandler.ListType.Todo))
                {
                    System.Console.WriteLine(task.ToString() +
                                             "\n-----------------------------------------------\n");
                }
                break;

            case (int)sortMenuItems.Doing:
                foreach (Task task in todoHandler.GetTasks(TodoHandler.ListType.Doing))
                {
                    System.Console.WriteLine(task.ToString() +
                                             "\n-----------------------------------------------\n");
                }
                break;

            case (int)sortMenuItems.Done:
                foreach (Task task in todoHandler.GetTasks(TodoHandler.ListType.Done))
                {
                    System.Console.WriteLine(task.ToString() +
                                             "\n-----------------------------------------------\n");
                }
                break;

            default:
                break;
            }
        }