public View(XMLWorker xw) { if (xw != null) { xmlWorker = xw; } else { throw new ArgumentException(); } }
public static void Main() { XMLWorker xw = new XMLWorker(); View view = new View(xw); bool end = false; string option = ""; while (!end) { Console.Clear(); view.ShowMainMenu(); option = Console.ReadLine(); Console.Clear(); switch (option) { case "1": view.ShowGuitars(); break; case "2": view.AddGuitar(); break; case "3": view.UpdateGuitar(); break; case "4": view.DeleteGuitar(); break; case "5": end = true; break; default: Console.WriteLine("Wrong option"); break; } Console.WriteLine("Press Enter to continue. . ."); Console.ReadKey(); //xw.xdoc.Save(xw.path); } }