Пример #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)
 {
 }