Exemple #1
0
        static void Main(string[] args)
        {
            BasicFlashlightSTM bfl = new BasicFlashlightSTM(new consoleFlashlight());


            while (true)
            {
                Console.ReadLine();
                bfl.HandleEvent(Event.Power);
            }
        }
Exemple #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);
                }
            }
        }