Exemple #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;
                }
            }
        }
Exemple #2
0
 public override void HandleMode(FlashLight fl)
 {
     fl.Flashing();
     fl.SetState(new Solid());
 }
Exemple #3
0
 public virtual void OnEnter(FlashLight fl)
 {
 }
Exemple #4
0
 public override void OnEnter(FlashLight fl)
 {
 }
Exemple #5
0
 public override void HandlePower(FlashLight fl)
 {
     fl.LightOn();
     fl.SetState(new On());
 }
Exemple #6
0
 public override void OnEnter(FlashLight fl)
 {
     fl.SetState(new Solid());
 }
Exemple #7
0
 public virtual void HandleMode(FlashLight fl)
 {
 }
Exemple #8
0
 public virtual void HandlePower(FlashLight fl)
 {
 }