Exemplo n.º 1
0
        static void Main(string[] args)
        {
            BasicFlashlightSTM bfl = new BasicFlashlightSTM(new consoleFlashlight());


            while (true)
            {
                Console.ReadLine();
                bfl.HandleEvent(Event.Power);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            BasicFlashlightSTM bfl = new BasicFlashlightSTM(new consoleFlashlight());


            while (true)
            {
                int key = Console.Read();
                if ((char)key == 'p')
                {
                    bfl.HandleEvent(Event.Power);
                }
                else if ((char)key == 'e')
                {
                    bfl.HandleEvent(Event.onEnter);
                }
            }
        }