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

            MainReminderProcesses.Refresh();
        }
示例#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();
        }
示例#3
0
        private async void InitAsync()
        {
            MainReminderProcesses.AddReminder(this);
            _nextReminder = await _snoozeData.GetSnoozedReminderAsync(ToString()); //can be null if there was nothing

            if (_nextReminder != null)
            {
                Snoozing = true;
                NextDate = _nextReminder.NextDate; //i think.
            }
            _started = true;
            //at this point needs to refresh.
        }