Example #1
0
        static void Main()
        {
            ClockSetup clockSetup = new ClockSetup();

            // Setup starts in 'year' state
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // year should be 1 on from current

            // Setup should now be in 'month' state
            clockSetup.RotateKnobRight();
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // month should be 2 on from current

            // Setup should now be in 'day' state
            clockSetup.RotateKnobRight();
            clockSetup.RotateKnobRight();
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // day should be 3 on from current

            // Setup should now be in 'hour' state
            clockSetup.RotateKnobLeft();
            clockSetup.RotateKnobLeft();
            clockSetup.PushKnob(); // hour should be 2 less than current

            // Setup should now be in 'minute' state
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // minute should be 1 on than current

            // Setup should now be in 'finished' state
            clockSetup.PushKnob(); // to display selected date

            Console.Read();
        }
Example #2
0
        static void Main()
        {
            ClockSetup clockSetup = new ClockSetup();

            // Setup starts in 'year' state
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // year should be 1 on from current

            // Setup should now be in 'month' state
            clockSetup.RotateKnobRight();
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // month should be 2 on from current

            // Setup should now be in 'day' state
            clockSetup.RotateKnobRight();
            clockSetup.RotateKnobRight();
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // day should be 3 on from current

            // Setup should now be in 'hour' state
            clockSetup.RotateKnobLeft();
            clockSetup.RotateKnobLeft();
            clockSetup.PushKnob(); // hour should be 2 less than current

            // Setup should now be in 'minute' state
            clockSetup.RotateKnobRight();
            clockSetup.PushKnob(); // minute should be 1 on than current

            // Setup should now be in 'finished' state
            clockSetup.PushKnob(); // to display selected date

            Console.Read();
        }
 public MonthSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     month           = DateTime.Now.Month;
 }
 public FinishedSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
 }
 public DaySetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     day             = DateTime.Now.Day;
 }
 public FinishedSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
 }
Example #7
0
 public MinuteSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     minute = DateTime.Now.Minute;
 }
Example #8
0
 public HourSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     hour            = DateTime.Now.Hour;
 }
Example #9
0
 public MonthSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     month = DateTime.Now.Month;
 }
 public YearSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     year            = DateTime.Now.Year;
 }
Example #11
0
 public HourSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     hour = DateTime.Now.Hour;
 }
Example #12
0
 public DaySetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     day = DateTime.Now.Day;
 }
 public MinuteSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     minute          = DateTime.Now.Minute;
 }
Example #14
0
 public YearSetupState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     year = DateTime.Now.Year;
 }