using System; using System.IO; using System.Collections.Generic; namespace Exercises_C_Sharp { class Program { static List OptionList = new(); public static void Main() { //Zuerst schauen, ob der Speicherordner existiert if(!Directory.Exists("saveFolder")) Directory.CreateDirectory("saveFolder"); //************************ //*******Einleitung******* //************************ ExerciseGroup beginnerElements = new() { Name = "1. Einleitung", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E01_Einleitung.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E01_Einleitung.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E01_Einleitung.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E01_Einleitung.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E01_Einleitung.Exercise_5.Start} } }; //************************ //*******Variablen******** //************************ ExerciseGroup variableElements = new() { Name = "2. Variablen", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E02_Variablen.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E02_Variablen.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E02_Variablen.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E02_Variablen.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E02_Variablen.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E02_Variablen.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E02_Variablen.Exercise_7.Start}, new(){Name = "Übung 8", Method = Exercises_C_Sharp.E02_Variablen.Exercise_8.Start}, new(){Name = "Übung 9", Method = Exercises_C_Sharp.E02_Variablen.Exercise_9.Start} } }; //************************ //********Strings********* //************************ ExerciseGroup stringElements = new() { Name = "3. Strings", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E03_Strings.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E03_Strings.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E03_Strings.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E03_Strings.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E03_Strings.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E03_Strings.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E03_Strings.Exercise_7.Start}, new(){Name = "Übung 8", Method = Exercises_C_Sharp.E03_Strings.Exercise_8.Start}, new(){Name = "Übung 9", Method = Exercises_C_Sharp.E03_Strings.Exercise_9.Start}, new(){Name = "Übung 10", Method = Exercises_C_Sharp.E03_Strings.Exercise_10.Start}, new(){Name = "Übung 11", Method = Exercises_C_Sharp.E03_Strings.Exercise_11.Start} } }; //************************ //********Konsole********* //************************ ExerciseGroup terminalElements = new() { Name = "4. Konsole", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E04_Konsole.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E04_Konsole.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E04_Konsole.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E04_Konsole.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E04_Konsole.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E04_Konsole.Exercise_6.Start} } }; //************************ //********Arrays********* //************************ ExerciseGroup arrayElements = new() { Name = "5. Arrays", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E05_Arrays.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E05_Arrays.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E05_Arrays.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E05_Arrays.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E05_Arrays.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E05_Arrays.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E05_Arrays.Exercise_7.Start}, new(){Name = "Übung 8", Method = Exercises_C_Sharp.E05_Arrays.Exercise_8.Start}, new(){Name = "Übung 9", Method = Exercises_C_Sharp.E05_Arrays.Exercise_9.Start}, new(){Name = "Übung 10", Method = Exercises_C_Sharp.E05_Arrays.Exercise_10.Start}, new(){Name = "Übung 11", Method = Exercises_C_Sharp.E05_Arrays.Exercise_11.Start}, new(){Name = "Übung 12", Method = Exercises_C_Sharp.E05_Arrays.Exercise_12.Start} } }; //************************ //********Random********** //************************ ExerciseGroup randomElements = new() { Name = "6. Random", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E06_Random.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E06_Random.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E06_Random.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E06_Random.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E06_Random.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E06_Random.Exercise_6.Start} } }; //************************ //*******DateTime********* //************************ ExerciseGroup datetimeElements = new() { Name = "6. DateTime", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E07_DateTime.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E07_DateTime.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E07_DateTime.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E07_DateTime.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E07_DateTime.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E07_DateTime.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E07_DateTime.Exercise_7.Start} } }; //************************ //********* IF *********** //************************ ExerciseGroup ifElements = new() { Name = "8. if", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E08_If.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E08_If.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E08_If.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E08_If.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E08_If.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E08_If.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E08_If.Exercise_7.Start}, new(){Name = "Übung 8", Method = Exercises_C_Sharp.E08_If.Exercise_8.Start}, new(){Name = "Übung 9", Method = Exercises_C_Sharp.E08_If.Exercise_9.Start}, new(){Name = "Übung 10", Method = Exercises_C_Sharp.E08_If.Exercise_10.Start}, new(){Name = "Übung 11", Method = Exercises_C_Sharp.E08_If.Exercise_11.Start}, new(){Name = "Übung 12", Method = Exercises_C_Sharp.E08_If.Exercise_12.Start}, new(){Name = "Übung 13", Method = Exercises_C_Sharp.E08_If.Exercise_13.Start}, new(){Name = "Übung 14", Method = Exercises_C_Sharp.E08_If.Exercise_14.Start}, new(){Name = "Übung 15", Method = Exercises_C_Sharp.E08_If.Exercise_15.Start}, new(){Name = "Übung 16", Method = Exercises_C_Sharp.E08_If.Exercise_16.Start}, new(){Name = "Übung 17", Method = Exercises_C_Sharp.E08_If.Exercise_17.Start}, new(){Name = "Übung 18", Method = Exercises_C_Sharp.E08_If.Exercise_18.Start} } }; //************************ //*******Flowchart******* TODO //************************ ExerciseGroup flowchartElements = new() { Name = "9. Flowcharts", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*******SwitchCase******* TODO //************************ ExerciseGroup switchcaseElements = new() { Name = "10. switch/case", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //***********FOR********** TODO //************************ ExerciseGroup forElements = new() { Name = "11. for", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //******Resize Array****** TODO //************************ ExerciseGroup resizeArrayElements = new() { Name = "12. Resize Array", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*******FOREACH******* TODO //************************ ExerciseGroup foreachElements = new() { Name = "13. foreach", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //**********WHILE********* TODO //************************ ExerciseGroup whileElements = new() { Name = "14. while", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*********DoWhile********* TODO //************************ ExerciseGroup dowhileElements = new() { Name = "15. switch/case", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*******breakcontinue******* TODO //************************ ExerciseGroup breakcontinueElements = new() { Name = "16. break / continue", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*******StructureDiagram******* TODO //************************ ExerciseGroup structurediagramElements = new() { Name = "17. Strukturdiagramm", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*******Methoden******* //************************ ExerciseGroup methodsElements = new() { Name = "18. Methoden", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start}, new(){Name = "Übung 2", Method = E18_Methods.Exercise_2.Start}, new(){Name = "Übung 3", Method = E18_Methods.Exercise_3.Start}, new(){Name = "Übung 4", Method = E18_Methods.Exercise_4.Start}, new(){Name = "Übung 5", Method = E18_Methods.Exercise_5.Start}, new(){Name = "Übung 6", Method = E18_Methods.Exercise_6.Start} } }; //************************ //*******Überladung******* //************************ ExerciseGroup ueberladungElements = new() { Name = "19. Überladung", ElementList = new List() { new(){Name = "Übung 1", Method = E19_Überladung.Exercise_1.Start}, new(){Name = "Übung 2", Method = E19_Überladung.Exercise_2.Start}, new(){Name = "Übung 3", Method = E19_Überladung.Exercise_3.Start}, new(){Name = "Übung 4", Method = E19_Überladung.Exercise_4.Start}, new(){Name = "Übung 5", Method = E19_Überladung.Exercise_5.Start} } }; //************************ //********LISTEN********** //************************ ExerciseGroup listElements = new() { Name = "20. Listen", ElementList = new List() { new(){Name = "Übung 1", Method = E20_Lists.Exercise_1.Start}, new(){Name = "Übung 2", Method = E20_Lists.Exercise_2.Start}, new(){Name = "Übung 3", Method = E20_Lists.Exercise_3.Start}, new(){Name = "Übung 4", Method = E20_Lists.Exercise_4.Start}, new(){Name = "Übung 5", Method = E20_Lists.Exercise_5.Start}, new(){Name = "Übung 6", Method = E20_Lists.Exercise_6.Start}, new(){Name = "Übung 7", Method = E20_Lists.Exercise_7.Start}, new(){Name = "Übung 8", Method = E20_Lists.Exercise_8.Start}, new(){Name = "Übung 9", Method = E20_Lists.Exercise_9.Start}, new(){Name = "Übung 10", Method = E20_Lists.Exercise_10.Start}, new(){Name = "Übung 11", Method = E20_Lists.Exercise_11.Start}, new(){Name = "Übung 12", Method = E20_Lists.Exercise_12.Start}, new(){Name = "Übung 13", Method = E20_Lists.Exercise_13.Start} } }; //************************ //*********Sorting********** //************************ ExerciseGroup sortingElements = new() { Name = "21. Sortieren", ElementList = new List() { new(){Name = "Übung 1", Method = E21_Sorting.Exercise_1.Start}, new(){Name = "Übung 2", Method = E21_Sorting.Exercise_2.Start}, new(){Name = "Übung 3", Method = E21_Sorting.Exercise_3.Start}, new(){Name = "Übung 4", Method = E21_Sorting.Exercise_4.Start}, new(){Name = "Übung 5", Method = E21_Sorting.Exercise_5.Start}, new(){Name = "Übung 6", Method = E21_Sorting.Exercise_6.Start}, new(){Name = "Übung 7", Method = E21_Sorting.Exercise_7.Start}, new(){Name = "Übung 8", Method = E21_Sorting.Exercise_8.Start} } }; //************************ //******Dictionary******** //************************ ExerciseGroup dictionaryElements = new() { Name = "22. Dictionary", ElementList = new List() { new(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.E22_Dictionary.Exercise_1.Start}, new(){Name = "Aufgabe 2", Method = Exercises_C_Sharp.E22_Dictionary.Exercise_2.Start}, new(){Name = "Aufgabe 3", Method = Exercises_C_Sharp.E22_Dictionary.Exercise_3.Start}, new(){Name = "Aufgabe 4", Method = Exercises_C_Sharp.E22_Dictionary.Exercise_4.Start}, new(){Name = "Aufgabe 5", Method = Exercises_C_Sharp.E22_Dictionary.Exercise_5.Start} } }; //************************ //*******ChatGPT******* TODO //************************ ExerciseGroup chatgptElements = new() { Name = "23. ChatGPT", ElementList = new() { new(){Name = "Übung 1", Method = E323_ChatGPT.Exercise_1.Start} } }; //************************ //*********Enums********** //************************ ExerciseGroup enumElements = new() { Name = "24. Enums", ElementList = new List() { new(){Name = "Übung 1", Method = E24_Enumns.Exercise_1.Start}, new(){Name = "Übung 2", Method = E24_Enumns.Exercise_2.Start}, new(){Name = "Übung 3", Method = E24_Enumns.Exercise_3.Start}, new(){Name = "Übung 4", Method = E24_Enumns.Exercise_4.Start}, new(){Name = "Übung 5", Method = E24_Enumns.Exercise_5.Start}, new(){Name = "Übung 6", Method = E24_Enumns.Exercise_6.Start}, new(){Name = "Übung 7", Method = E24_Enumns.Exercise_7.Start}, new(){Name = "Übung 8", Method = E24_Enumns.Exercise_8.Start}, new(){Name = "Übung 9", Method = E24_Enumns.Exercise_9.Start}, new(){Name = "Übung 10", Method = E24_Enumns.Exercise_10.Start}, new(){Name = "Übung 11", Method = E24_Enumns.Exercise_11.Start}, new(){Name = "Übung 12", Method = E24_Enumns.Exercise_12.Start}, new(){Name = "Übung 13", Method = E24_Enumns.Exercise_13.Start} } }; //************************ //*********Tuple********** //************************ ExerciseGroup tupleElements = new() { Name = "25. Tuple", ElementList = new List() { new(){Name = "Übung 1", Method = E25_Tuple.Exercise_1.Start}, new(){Name = "Übung 2", Method = E25_Tuple.Exercise_2.Start}, new(){Name = "Übung 3", Method = E25_Tuple.Exercise_3.Start}, new(){Name = "Übung 4", Method = E25_Tuple.Exercise_4.Start}, new(){Name = "Übung 5", Method = E25_Tuple.Exercise_5.Start}, new(){Name = "Übung 6", Method = E25_Tuple.Exercise_6.Start}, new(){Name = "Übung 7", Method = E25_Tuple.Exercise_7.Start}, new(){Name = "Übung 8", Method = E25_Tuple.Exercise_8.Start}, new(){Name = "Übung 9", Method = E25_Tuple.Exercise_9.Start} } }; //************************ //*Mehrdimensinale Arrays* //************************ ExerciseGroup moredimensionalArrayElements = new() { Name = "26. Mehrdimensinale Arrays", ElementList = new List() { new(){Name = "Übung 1", Method = E26_Mehrdimensionale_Arrays.Exercise_1.Start}, new(){Name = "Übung 2", Method = E26_Mehrdimensionale_Arrays.Exercise_2.Start}, new(){Name = "Übung 3", Method = E26_Mehrdimensionale_Arrays.Exercise_3.Start}, new(){Name = "Übung 4", Method = E26_Mehrdimensionale_Arrays.Exercise_4.Start}, new(){Name = "Übung 5", Method = E26_Mehrdimensionale_Arrays.Exercise_5.Start}, new(){Name = "Übung 6", Method = E26_Mehrdimensionale_Arrays.Exercise_6.Start}, new(){Name = "Übung 7", Method = E26_Mehrdimensionale_Arrays.Exercise_7.Start} } }; //************************ //******Jagged Arrays***** //************************ ExerciseGroup jaggedArrayElements = new() { Name = "27. Jagged Arrays", ElementList = new List() { new(){Name = "Übung 1", Method = E27_Jagged_Arrays.Exercise_1.Start}, new(){Name = "Übung 2", Method = E27_Jagged_Arrays.Exercise_2.Start}, new(){Name = "Übung 3", Method = E27_Jagged_Arrays.Exercise_3.Start}, new(){Name = "Übung 4", Method = E27_Jagged_Arrays.Exercise_4.Start} } }; //************************ //********Klassen********* //************************ ExerciseGroup classElements = new() { Name = "28. Klassen", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E28_Classes.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E28_Classes.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E28_Classes.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E28_Classes.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E28_Classes.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E28_Classes.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E28_Classes.Exercise_7.Start} } }; //************************ //****Konstruktoren******* //************************ ExerciseGroup constructorElements = new() { Name = "29. Konstruktoren", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E29_Konstruktoren.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E29_Konstruktoren.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E29_Konstruktoren.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E29_Konstruktoren.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E29_Konstruktoren.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E29_Konstruktoren.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E29_Konstruktoren.Exercise_7.Start} } }; //************************ //*******Klassendiagram******* TODO //************************ ExerciseGroup classdiagramElements = new() { Name = "30. Klassendiagram", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*******RAM******* TODO //************************ ExerciseGroup ramElements = new() { Name = "31. RAM", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //******Exceptions******** //************************ ExerciseGroup exceptionElements = new() { Name = "32. Exceptions", ElementList = new List() { new(){Name = "Übung 1", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_1.Start}, new(){Name = "Übung 2", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_2.Start}, new(){Name = "Übung 3", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_3.Start}, new(){Name = "Übung 4", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_4.Start}, new(){Name = "Übung 5", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_5.Start}, new(){Name = "Übung 6", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_6.Start}, new(){Name = "Übung 7", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_7.Start}, new(){Name = "Übung 8", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_8.Start}, new(){Name = "Übung 9", Method = Exercises_C_Sharp.E32_Exceptions.Exercise_9.Start} } }; //************************ //*******Methodeninformationen******* TODO //************************ ExerciseGroup methodinformationElements = new() { Name = "33. Methodeninformationen", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //*******UseCaseDiagram******* TODO //************************ ExerciseGroup usecasediagramElements = new() { Name = "34. Use Case Diagram", ElementList = new() { new(){Name = "Übung 1", Method = E18_Methods.Exercise_1.Start} } }; //************************ //***Dateizugriffe******** //************************ ExerciseGroup filesystemElements = new() { Name = "35. Dateizugriffe", ElementList = new List() { new(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_1.Start}, new(){Name = "Aufgabe 2", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_2.Start}, new(){Name = "Aufgabe 3", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_3.Start}, new(){Name = "Aufgabe 4", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_4.Start}, new(){Name = "Aufgabe 5", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_5.Start}, new(){Name = "Aufgabe 6", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_6.Start}, new(){Name = "Aufgabe 7", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_7.Start}, new(){Name = "Aufgabe 8", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_8.Start}, new(){Name = "Aufgabe 8b", Method = Exercises_C_Sharp.E35_Dateizugriffe.Exercise_8b.Start} } }; //************************ //******Dateiformate****** //************************ ExerciseGroup fileformatsElements = new() { Name = "36. Dateiformate", ElementList = new() { new(){Name = "Übung 1", Method = E36_Dateiforamte.Exercise_1.Start}, new(){Name = "Übung 2", Method = E36_Dateiforamte.Exercise_2.Start} } }; //************************ //*****Serialisierung***** //************************ ExerciseGroup serializeElements = new() { Name = "37. Serialisierung", ElementList = new List() { new(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.E37_Serialisierung.Exercise_1.Start} } }; //************************ //***********MySQL******** //************************ ExerciseGroup mysqlElements = new() { Name = "38. MySQL", ElementList = new List() { new(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.E38_MySQL.Exercise_1.Start}, new(){Name = "Aufgabe 2", Method = Exercises_C_Sharp.E38_MySQL.Exercise_2.Start} } }; //************************ //******* Vererbung ****** //************************ ExerciseGroup vererbungElements = new() { Name = "40. Vererbung", ElementList = new List() { new(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.E40_Vererbung.Exercise_1.Start}, new(){Name = "Aufgabe 2", Method = Exercises_C_Sharp.E40_Vererbung.Exercise_2.Start}, new(){Name = "Aufgabe 3", Method = Exercises_C_Sharp.E40_Vererbung.Exercise_3.Start}, new(){Name = "Aufgabe 3", Method = Exercises_C_Sharp.E40_Vererbung.Exercise_4.Start} } }; //************************ //******* Interfaces ***** //************************ ExerciseGroup interfaceElements = new() { Name = "42. Interfaces", ElementList = new List() { new(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.E42_Interfaces.Exercise_1.Start}, new(){Name = "Aufgabe 2", Method = Exercises_C_Sharp.E42_Interfaces.Exercise_2.Start}, new(){Name = "Aufgabe 3", Method = Exercises_C_Sharp.E42_Interfaces.Exercise_3.Start}, new(){Name = "Aufgabe 4", Method = Exercises_C_Sharp.E42_Interfaces.Exercise_4.Start} } }; //************************ //******* Kapselung ****** //************************ ExerciseGroup kapselungElements = new() { Name = "44. Kapselung", ElementList = new List() { new(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.E44_Kapselung.Exercise_1.Start}, new(){Name = "Aufgabe 2", Method = Exercises_C_Sharp.E44_Kapselung.Exercise_2.Start}, new(){Name = "Aufgabe 3", Method = Exercises_C_Sharp.E44_Kapselung.Exercise_3.Start} } }; //************************ //******** Pattern ******* //************************ ExerciseGroup patternElements = new() { Name = "46. Designpattern", ElementList = new List() { new(){Name = "Singleton", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_1.Start}, new(){Name = "Factory", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_2.Start}, new(){Name = "Observer", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_3.Start}, new(){Name = "Strategy", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_4.Start}, new(){Name = "Decorator", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_5.Start}, new(){Name = "Adapter", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_6.Start}, new(){Name = "Facade", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_7.Start}, new(){Name = "Command", Method = Exercises_C_Sharp.E46_Designpattern.Exercise_8.Start} } }; //************************ //****Sonderaufgaben****** //************************ ExerciseGroup specialElements = new() { Name = "Sonderaufgaben", ElementList = new List() { new(){Name = "Schere Stein Papier Echse Spock", Method = Exercises_C_Sharp.Sonderaufgaben.Exercise_1.Start}, new(){Name = "Schiffe versenken", Method = Exercises_C_Sharp.Sonderaufgaben.Exercise_2.Start}, new(){Name = "Memory", Method = Exercises_C_Sharp.Sonderaufgaben.Exercise_3.Start}, new(){Name = "Minesweeper", Method = Exercises_C_Sharp.Sonderaufgaben.Exercise_4.Start}, new(){Name = "Kniffel", Method = Exercises_C_Sharp.Sonderaufgaben.Exercise_5.Start}, new(){Name = "Mensch ärgere Dich nicht", Method = Exercises_C_Sharp.Sonderaufgaben.Exercise_6.Start} } }; //************************ //*Entwicklungsaufgaben*** //************************ ExerciseGroup developElements = new() { Name = "Entwicklungsaufgaben", ElementList = new List() { new(){Name = "Dynamische Eingaben in Echtzeit", Method = Exercises_C_Sharp.Entwicklungsaufgaben.Minispiele.Step_1.Start} } }; //************************ //****Schulaufgaben******* //************************ ExerciseGroup examElements = new() { Name = "Schulaufgaben", ElementList = new() { new(){Name = "001 Klassen", Method = Exercises_C_Sharp.Schulaufgaben.S001_Class.Start}, new(){Name = "002 Klassen", Method = Exercises_C_Sharp.Schulaufgaben.S002_Class.Start}, new(){Name = "003 Tuple", Method = Exercises_C_Sharp.Schulaufgaben.S003_Tuple.Start}, new(){Name = "004 Enum", Method = Exercises_C_Sharp.Schulaufgaben.S004_Enum.Start}, new(){Name = "005 Tuple", Method = Exercises_C_Sharp.Schulaufgaben.S005_Tuple.Start}, new(){Name = "006 Multidimensionale Arrays", Method = Exercises_C_Sharp.Schulaufgaben.S006_Multidimensionale_Arrays.Start}, new(){Name = "007 Enum", Method = Exercises_C_Sharp.Schulaufgaben.S007_Enum.Start}, new(){Name = "008 Enum", Method = Exercises_C_Sharp.Schulaufgaben.S008_Enum.Start} } }; //************************ //****Eigenaufgaben******* //************************ ExerciseGroup ownExercises = new() { Name = "Eigenaufgaben", ElementList = new() { new(){Name = "Benchmark", Method = Exercises_C_Sharp.Eigenaufgaben.Exercise_1.Start} } }; //Zusammenführung OptionList = new List(){ beginnerElements, variableElements, stringElements, terminalElements, arrayElements, randomElements, datetimeElements, ifElements, flowchartElements, switchcaseElements, forElements, resizeArrayElements, foreachElements, whileElements, dowhileElements, breakcontinueElements, structurediagramElements, methodsElements, ueberladungElements, listElements, sortingElements, dictionaryElements, chatgptElements, enumElements, tupleElements, moredimensionalArrayElements, jaggedArrayElements, classElements, constructorElements, classdiagramElements, ramElements, exceptionElements, methodinformationElements, usecasediagramElements, filesystemElements, fileformatsElements, serializeElements, mysqlElements, vererbungElements, interfaceElements, kapselungElements, patternElements, specialElements, developElements, examElements }; Menu(); } //ToDo: Einzelne Lektionen nebeneinander anzeigen //ToDo: Senden, um zu überprüfen, ob alles richtig ist //ToDo: Element als erledigt markieren static void Menu() { Console.Clear(); Console.SetCursorPosition(0,0); LoadMarkedExercises(); var pos = LoadCurrentElementAndCurrentList(); int currentElement = pos.Item1; int currentList = pos.Item2; while(true) { Console.Clear(); Console.WriteLine("Navigation: Pfeiltasten nach oben/unten und Enter"); Console.WriteLine("______________________________"); for(int k = 0; k < OptionList.Count; k++) { var element = OptionList[k]; //Console.ReadKey(); if(currentList == k) { Console.WriteLine("*****************************"); Console.WriteLine(element.Name); Console.WriteLine("*****************************"); for(int i = 0; i < element.ElementList.Count; i++) { //Der erste Wert vorne ist dafür gedacht, dass markiert wird, wenn die Aufgabe abgegeben und korregiert wurde --> ToDo Console.WriteLine("{2}{1}[{0}] " + element.ElementList[i].Name, currentElement == i && currentList == k ? "X" : " ", !element.ElementList[i].IsMarked ? " " : "#", element.ElementList[i].FinishState == false ? "NO" : element.ElementList[i].FinishState == false == true ? "OK" : " "); } Console.WriteLine("______________________________"); } else { Console.WriteLine(element.Name); } } var key = Console.ReadKey(); if(key.Key == ConsoleKey.UpArrow) { Console.Clear(); if(currentElement == 0 && currentList == 0) { currentList = OptionList.Count -1; currentElement = OptionList[OptionList.Count -1].ElementList.Count -1; } else if(currentElement == 0 && currentList > 0) { currentList--; currentElement = OptionList[currentList].ElementList.Count -1; } else currentElement--; } else if(key.Key == ConsoleKey.DownArrow) { Console.Clear(); if(currentElement == OptionList[currentList].ElementList.Count - 1 && currentList == OptionList.Count -1) { currentList = 0; currentElement = 0; } else if(currentElement == OptionList[currentList].ElementList.Count - 1 && currentList < OptionList.Count -1) { currentList++; currentElement = 0; } else { currentElement++; } } else if(key.Key == ConsoleKey.Enter) { Console.Clear(); try { SaveCurrentElementAndCurrentList(currentElement, currentList); OptionList[currentList].ElementList[currentElement].Method(); } catch(Exception ex) { Console.WriteLine("******************"); Console.WriteLine("***** Fehler *****"); Console.WriteLine("******************"); Console.WriteLine("Bei der Aufgabe ist folgender Fehler aufgetreten:"); Console.WriteLine(ex.ToString()); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Aufgabe beendet. Zum Weitermachen Taste drücken..."); Console.ReadKey(); } else if(key.Key == ConsoleKey.X) { Console.Clear(); var el = OptionList[currentList].ElementList[currentElement]; if(el.IsMarked == false) OptionList[currentList].ElementList[currentElement].IsMarked = true; else OptionList[currentList].ElementList[currentElement].IsMarked = false; SaveMarkedExercises(); } else if(key.Key == ConsoleKey.RightArrow) { //ToDo: Absenden und überprüfen } else if(key.Key == ConsoleKey.V) { //Zum Videomenu OpenLinkToVideo.ShowVideoMenu(OptionList[currentList], OptionList[currentList].ElementList[currentElement]); } Console.Clear(); } } //Speichert das zuletzt ausgewählte Element static void SaveCurrentElementAndCurrentList(int currentElement, int currentList) { try { if(File.Exists("lastPoint")) File.Delete("lastPoint"); File.WriteAllLines("lastPoint", new List(){currentElement.ToString(), currentList.ToString()}); } catch(Exception ex) { Console.WriteLine("Sorry, habe anscheindend einen Fehler reinprogrammiert. Ihre Aufgabe ist nun, den Fehler in der Program.cs zu finden und zu fixen. Hierfür bekommen Sie folgenden Hinweis:"); Console.WriteLine(ex.ToString()); } } static Tuple LoadCurrentElementAndCurrentList() { try { if(!File.Exists("lastPoint")) return new Tuple(0,0); var el = File.ReadAllLines("lastPoint"); return new Tuple(Convert.ToInt32(el[0]), Convert.ToInt32(el[1])); } catch(Exception ex) { Console.WriteLine("Sorry, habe anscheindend einen Fehler reinprogrammiert. Ihre Aufgabe ist nun, den Fehler in der Program.cs zu finden und zu fixen. Hierfür bekommen Sie folgenden Hinweis:"); Console.WriteLine(ex.ToString()); } return new Tuple(0,0); } //ToDo: Richtiges Abspeichern implementieren!!! //Speichert die markierten Aufgaben ab static void SaveMarkedExercises() { List saveList = new List(); foreach(var element in OptionList) { foreach(var item in element.ElementList) { if(item.IsMarked == true) { saveList.Add(string.Format("{0}{1} {2}", element.Name, item.Name, item.IsMarked.ToString())); } } } File.WriteAllLines("markingSave", saveList); } static void LoadMarkedExercises() { if(!File.Exists("markingSave")) return; var el = File.ReadAllLines("markingSave"); Dictionary dic = new Dictionary(); foreach(var element in el) { string str = element.Substring(0, element.LastIndexOf(" ")); bool b = Convert.ToBoolean(element.Substring(element.LastIndexOf(" ") + 1)); dic.Add(str, b); } foreach(var element in OptionList) { for(int i = 0; i < element.ElementList.Count; i++) { var key = string.Format("{0}{1}", element.Name, element.ElementList[i].Name); if(dic.ContainsKey(key)) { element.ElementList[i].IsMarked = dic[key]; } } } } } }