public void JumpToClass(int pageView) { ModifyList modList = new ModifyList(); var wholeList = modList.CompileTxt(); //foreach (string i in wholeList) //{ // Console.WriteLine(i); //} //Console.WriteLine("\n\n"); ; if (pageView == 1) { Console.WriteLine("\nPage 1 contains : "); modList.ReListAsPage1(wholeList); } if (pageView == 2) { Console.WriteLine("\nPage 2 contains : "); modList.ReListAsPage2(wholeList); } if (pageView == 3) { Console.WriteLine("\nPage 3 contains : "); modList.ReListAsPage3(wholeList); } }
int FirstTaskList() { ModifyList pullList = new ModifyList(); int i = 0; List <string> orderedList = pullList.CompileTxt(); string modifyFirst; bool complete = orderedList[i].Contains(" -c"); Console.WriteLine("_____________________________________________________________________"); do { if (i == 0 && complete == true) { orderedList.RemoveAt(i); StreamWriter saveList = new StreamWriter("LongList.txt", false); foreach (string j in orderedList) { saveList.WriteLine(j); } saveList.Close(); } if (complete == true) { Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine($"\n\n{orderedList[i]}"); } if (complete == false) { Console.ForegroundColor = ConsoleColor.White; Console.WriteLine($"\n\n{orderedList[i]}"); } Console.WriteLine("\n\nWould you like to modify or skip this task?"); Console.WriteLine("Enter 'Y' or 'N' or <esc> to quit"); modifyFirst = Console.ReadLine(); if (String.IsNullOrEmpty(modifyFirst)) { MenuLoop(); } if (modifyFirst != "Y") { i++; } } while (modifyFirst != "Y"); ModifyFirst(i); return(i); }
void ReadMyList() { ModifyList redo = new ModifyList(); List <string> orderedList = redo.CompileTxt(); int i = 0; while (i < orderedList.Count) { bool star = orderedList[i].Contains(" -c"); if (i == 0 && star == true) { orderedList.RemoveAt(0); } if (i == 0) { Console.BackgroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.Black; Console.WriteLine(orderedList[i]); } if (i > 0) { if (star == true) { Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine(orderedList[i]); } else { Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.White; Console.WriteLine(orderedList[i]); } } i++; } Console.WriteLine("There were {0} lines.", i); Console.WriteLine("Return to menu press ENTER"); Console.ReadLine(); MenuLoop(); }
void Modify(int userInput, int i) { ModifyList redo = new ModifyList(); if (userInput == 1) { if (i == 0) { List <string> orderedList = redo.CompileTxt(); orderedList.RemoveAt(i); StreamWriter saveList = new StreamWriter("LongList.txt", false); foreach (var j in orderedList) { saveList.WriteLine(j); } saveList.Close(); } if (i > 0) { List <string> orderedList = redo.CompileTxt(); string temp = orderedList[i]; int index = orderedList.IndexOf(temp); orderedList[index] = temp + " -c"; StreamWriter saveList = new StreamWriter("LongList.txt", false); foreach (var j in orderedList) { saveList.WriteLine(j); } saveList.Close(); } } if (userInput == 2) { List <string> orderedList = redo.CompileTxt(); string temp = orderedList[i]; string crossout = temp + " -c"; orderedList[i] = crossout; orderedList.Add(temp); StreamWriter saveList = new StreamWriter("LongList.txt", false); foreach (var j in orderedList) { saveList.WriteLine(j); } saveList.Close(); } if (userInput == 3) { string modifyFirst; do { List <string> orderedList = redo.CompileTxt(); Console.WriteLine(orderedList[i]); Console.WriteLine("\n\nWould you like to modify this task?"); Console.WriteLine("Enter 'Y' or 'N'"); modifyFirst = Console.ReadLine(); i++; } while (modifyFirst == "N"); if (modifyFirst == "Y") { ModifyFirst(i); } else { Console.WriteLine("Return to menu press ENTER"); Console.ReadLine(); MenuLoop(); } } }