예제 #1
0
        static void Main(string[] args)
        {
            FlashLight _myFlashlight = new FlashLight();
            var        mode          = 'x';



            while (char.ToUpper(mode) != 'Q')
            {
                Console.WriteLine("Enter event: ");
                mode = Console.ReadKey().KeyChar;

                switch (char.ToUpper(mode))
                {
                case 'X':
                    _myFlashlight.X();
                    break;

                case 'Y':
                    _myFlashlight.Y();
                    break;
                }
            }
        }
예제 #2
0
 public override void HandleMode(FlashLight fl)
 {
     fl.Flashing();
     fl.SetState(new Solid());
 }
예제 #3
0
 public virtual void OnEnter(FlashLight fl)
 {
 }
예제 #4
0
 public override void OnEnter(FlashLight fl)
 {
 }
예제 #5
0
 public override void HandlePower(FlashLight fl)
 {
     fl.LightOn();
     fl.SetState(new On());
 }
예제 #6
0
 public override void OnEnter(FlashLight fl)
 {
     fl.SetState(new Solid());
 }
예제 #7
0
 public virtual void HandleMode(FlashLight fl)
 {
 }
예제 #8
0
 public virtual void HandlePower(FlashLight fl)
 {
 }