private string GetNotificationInterval(RepeatNotificationConfig notificationConfig)
    {
        TimeSpan interval = notificationConfig.GetInterval();

        string length = string.Empty;

        if (interval.Days > 0)
        {
            length += $"{interval.Days} Days";
        }
        if (interval.Hours > 0)
        {
            length += $"{interval.Hours} Hours";
        }
        if (interval.Minutes > 0)
        {
            length += $"{interval.Minutes} Minutes";
        }
        if (interval.Seconds > 0)
        {
            length += $"{interval.Seconds} Seconds";
        }

        return(length);
    }
Пример #2
0
 private void InitializeStartingRepeatNotifications()
 {
     foreach (int index in startingRepeatNotifications)
     {
         RepeatNotificationConfig notification = AllRepeatNotifications[index];
         int id = SendNotification(notification);
         ActiveRepeatNotificationsIDs.Add(id);
         ActiveRepeatNotificationsIndexes.Add(index);
     }
 }
Пример #3
0
    public int ChangeRepeatNotification(int newNotifIndex, int activeNotifToCancel)
    {
        RepeatNotificationConfig newNotifConfig = AllRepeatNotifications[newNotifIndex];
        int oldNotifId = ActiveRepeatNotificationsIDs[activeNotifToCancel];
        int newNotifId = SendNotification(newNotifConfig);

        AndroidNotificationCenter.CancelNotification(oldNotifId);
        ActiveRepeatNotificationsIDs[activeNotifToCancel]     = newNotifId;
        ActiveRepeatNotificationsIndexes[activeNotifToCancel] = newNotifIndex;

        return(newNotifId);
    }