Пример #1
0
        private static AirPurifier GenAirPurifier(int number)
        {
            var airPurifier = new AirPurifier(string.Format("CESCO{0:D3}", number + 1));

            airPurifier.AttachOutput(new ConsoleDash());
            airPurifier.AttachOutput(new IoTHubDash());
            airPurifier.TurnOn(true);
            return(airPurifier);
        }
Пример #2
0
        static void Main(string[] args)
        {
            int instanceCount = Properties.Settings.Default.InstanceCount;
            List <IAirpurifier> arrayAirPurifier = new List <IAirpurifier>();

            for (int i = 0; i < instanceCount; i++)
            {
                AirPurifier airPurifier = GenAirPurifier(i);
                arrayAirPurifier.Add(airPurifier);
            }
            Console.ReadLine();
        }