コード例 #1
0
        async Task ExecuteReminderCommandAsync()
        {
            if (!IsReminderSet)
            {
                var result = await ReminderService.AddReminderAsync(
                    Session.Id,
                    new Plugin.Calendars.Abstractions.CalendarEvent
                {
                    AllDay      = false,
                    Description = Session.Abstract,
                    Location    =
                        Session.Room?.Name
                        ?? string.Empty,
                    Name  = Session.Title,
                    Start = Session.StartTime.Value,
                    End   = Session.EndTime.Value
                });


                if (!result)
                {
                    return;
                }

                Logger.Track(EvolveLoggerKeys.ReminderAdded, "Title", Session.Title);
                IsReminderSet = true;
            }
            else
            {
                var result = await ReminderService.RemoveReminderAsync(Session.Id);

                if (!result)
                {
                    return;
                }
                Logger.Track(EvolveLoggerKeys.ReminderRemoved, "Title", Session.Title);
                IsReminderSet = false;
            }
        }
コード例 #2
0
        async Task ExecuteReminderCommandAsync()
        {
            if (!IsReminderSet)
            {
                var result = await ReminderService.AddReminderAsync("event_" + Event.Id,
                                                                    new Plugin.Calendars.Abstractions.CalendarEvent
                {
                    Description = Event.Description,
                    Location    = Event.LocationName,
                    AllDay      = Event.IsAllDay,
                    Name        = Event.Title,
                    Start       = Event.StartTime.Value,
                    End         = Event.EndTime.Value
                });


                if (!result)
                {
                    return;
                }

                Logger.Track(EvolveLoggerKeys.ReminderAdded, "Title", Event.Title);
                IsReminderSet = true;
            }
            else
            {
                var result = await ReminderService.RemoveReminderAsync("event_" + Event.Id);

                if (!result)
                {
                    return;
                }
                Logger.Track(EvolveLoggerKeys.ReminderRemoved, "Title", Event.Title);
                IsReminderSet = false;
            }
        }