Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Garland garland1 = new ColoredLamp();

            garland1.CurrentState();

            Garland garland2 = new OrdinaryLamp();

            garland2.CurrentState();
        }
Exemplo n.º 2
0
        public override void CurrentState()
        {
            Console.WriteLine("How many lamps in the ordinary garland");
            Garland ordinarynumber = new OrdinaryLamp();

            OrdinaryCount = ordinarynumber.CheckNumber();
            Console.WriteLine("Count of lamps is" + OrdinaryCount);

            List <OrdinaryLamp> ColoredLampList = new List <OrdinaryLamp> // Populate List
            {
                new OrdinaryLamp {
                    ID = 1, State = "a"
                }
            };
        }