Пример #1
0
 public View(XMLWorker xw)
 {
     if (xw != null)
     {
         xmlWorker = xw;
     }
     else
     {
         throw new ArgumentException();
     }
 }
Пример #2
0
        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);
            }
        }