Esempio n. 1
0
        async Task IHandleAsync <ReminderUpdatedEventModel> .HandleAsync(ReminderUpdatedEventModel message)
        {
            //this means needs to refresh.
            await RefreshAsync(); //hopefully this simple (?)

            MainReminderProcesses.Refresh();
        }
Esempio n. 2
0
        protected async Task AdjustTimeAsync(DateTime time)
        {
            DateTime tempDate;

            if (Snoozing)
            {
                //await _snoozeData.DeleteSnoozeAsync(ToString()); //i think its best to just delete the previous one if any.
                //i think just add to the snooze.
                if (NextDate == null)
                {
                    throw new BasicBlankException("Can't adjust minutes for snooze because next date is null.  Rethink");
                }
                tempDate = NextDate.Value;
                //NextDate = NextDate.Value.AddMinutes(minutes);
                NextDate = new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, time.Hour, time.Minute, 0);
                await _snoozeData.UpdateSnooozeAsync(ToString(), NextDate.Value);

                MainReminderProcesses.Refresh();
                return;
            }
            _nextReminder = await GetNextReminderAsync();

            //must check for next one first.
            if (_nextReminder == null)
            {
                throw new BasicBlankException("Can't snooze minutes because no reminder.  Rethink");
            }
            Snoozing = true;
            NextDate = _nextReminder.NextDate;
            tempDate = NextDate.Value;
            NextDate = new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, time.Hour, time.Minute, 0);
            await _snoozeData.SaveSnoozeAsync(ToString(), _nextReminder, NextDate.Value);

            MainReminderProcesses.Refresh();
        }