Пример #1
0
 /// <summary>
 /// Constructor: initializes snoozeUntilTime to harmless value
 /// </summary>
 public AlarmController()
 {
     this.alarmList       = new List <Alarm>();
     this.audioController = AbstractAudioController.GetController();
     this.guiController   = AbstractGuiController.GetController();
     this.snoozeUntilTime = TimeFetcher.getCurrentTime();
 }
Пример #2
0
        /// <summary>
        /// Called when the timezone offset changes
        /// </summary>
        /// <param name="offset"></param>
        public void TimeZoneOffsetChanged(double offset)
        {
            double localOffset = GetLocalTimeZoneOffset();

            AbstractGuiController.GetController().SetActiveTimeZoneForDisplay(offset + localOffset);
            TimeFetcher.setOffset(offset);
        }
Пример #3
0
        public void AlarmRequested(int hour, int minute, bool repeat, string audioFile, bool weekly, List <DayOfWeek> days, string AlarmName)
        {
            Alarm newAlarm = new Alarm(hour, minute, repeat, audioFile, weekly, days, AlarmName);

            AbstractGuiController.GetController().AddAlarm(newAlarm);
            alarmList.Add(newAlarm);
        }
Пример #4
0
 /// <summary>
 /// Called when the main window is shutting down
 /// </summary>
 public void MainWindowShutdown()
 {
     foreach (Alarm alarm in alarmList)
     {
         if (alarm.IsRinging)
         {
             AlarmDismissed(false);
             break;
         }
     }
     Teardown();
     if (alarmList.Count == 0)
     {
         AbstractGuiController.GetController().Shutdown();
     }
 }
Пример #5
0
        /// <summary>
        /// Setup default timezone
        /// </summary>
        public void Setup()
        {
            double localOffset = GetLocalTimeZoneOffset();

            AbstractGuiController.GetController().SetActiveTimeZoneForDisplay(localOffset);
        }
Пример #6
0
 /// <summary>
 /// Called whenever a time pulse occurs
 /// </summary>
 /// <param name="currentTime"></param>
 public void TimePulse(DateTime currentTime)
 {
     AbstractGuiController.GetController().SetTime(currentTime);
 }
Пример #7
0
 public void AlarmEdited(Alarm alarm, string name, int hour, int minute, bool repeat, string audioFile, bool weekly, List <DayOfWeek> days)
 {
     alarm.EditAlarm(name, hour, minute, repeat, audioFile, weekly, days);
     //reflect the changes in the gui
     AbstractGuiController.GetController().EditAlarm(alarm);
 }