Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            TimerSetup setup = new TimerSetup();

            setup.ShowDisplay();

            setup.OnTimerPressed();
            setup.ShowDisplay();

            setup.OnUpPressed();
            setup.OnUpPressed();
            setup.ShowDisplay();

            setup.OnOkPressed();
            setup.OnDownPressed();
            setup.OnDownPressed();
            setup.OnDownPressed();
            setup.ShowDisplay();

            setup.OnOkPressed();
            setup.ShowDisplay();

            // Timer setup finished
            setup.OnOkPressed();
            setup.ShowDisplay();

            Console.WriteLine($"Timer was set to {setup.TimerSet}");
        }
Ejemplo n.º 2
0
 public NormalState(TimerSetup context) : base(context)
 {
 }
Ejemplo n.º 3
0
        public SetHoursState(TimerSetup context) : base(context)
        {
            DateTime now = DateTime.Now;

            _timerHours = now.Hour;
        }
Ejemplo n.º 4
0
 public TimerSetupStateBase(TimerSetup context) => _context = context;