static void Main(string[] args) { BasicFlashlightSTM bfl = new BasicFlashlightSTM(new consoleFlashlight()); while (true) { Console.ReadLine(); bfl.HandleEvent(Event.Power); } }
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); } } }