Exemple #1
0
        static void Main(string[] args)
        // import CSV initial list of items
        {
            string        currentDirectory = Directory.GetCurrentDirectory();
            DirectoryInfo directory        = new DirectoryInfo(currentDirectory);
            var           fileName         = Path.Combine(directory.FullName, "SmartHomeInventory.csv");

            _device.AddRange(ReadSmartHome(fileName));

            // Display menu upon running program
            Welcome.DisplayWelcome();

            // Menu options
            int option = 0;

            while ((option = Menu.Prompt()) != 4)
            {
                switch (option)
                {
                case 1:
                    AddDevice();
                    break;

                // case 2:
                //     RemoveDevice();
                //     break;
                case 2:
                    DisplayDeviceList();
                    break;

                case 3:
                    SaveList();
                    break;
                }
            }
        }