public void AddNewAutoReminders()
        {
            // only if startingtime is "set" and at least one of hours days and months years is > 0
            if (AutoAddMinutes > 0 || AutoAddHours > 0 || AutoAddDays > 0 || AutoAddMonths > 0 || AutoAddYears > 0)
            {
                while (AutoReminders.Count < MinimalAutoRemindersCount)
                {
                    var nextTime = GetNextRemindTime();

                    // AutoReminder
                    var reminder = new Reminder(this, nextTime);
                    AutoReminders.Add(reminder);

                    // AutoReminderWithOffset
                    if (!AutoOffset.Equals(TimeSpan.Zero))
                    {
                        var offsetReminder = new Reminder(this, nextTime.Add(AutoOffset));
                        offsetReminder.IsOffsetReminder = true;
                        AutoOffsetReminders.Add(offsetReminder);
                    }

                    StartingTime = nextTime;
                }
            }
        }
Пример #2
0
 private static void ReadOffsets(out double inLineOffset, out double betweenLineOffset, int propsCount)
 {
     Console.WriteLine("Specify offset in line (or just press enter for automatic offsets): ");
     LogManager.Log("Reading offsets...");
     inLineOffset = ReadUntilValid();
     if (inLineOffset < 0)
     {
         LogManager.Log("Auto Offsets were chosen");
         AutoOffset autoOffset = new AutoOffset(propsCount);
         inLineOffset      = autoOffset.Height;
         betweenLineOffset = autoOffset.Width;
         Console.WriteLine($"Automatic offsets: {inLineOffset} {betweenLineOffset}");
     }
     else
     {
         Console.WriteLine("Specify offset between lines:");
         betweenLineOffset = ReadUntilValid();
         LogManager.Log($"User offsets: {inLineOffset} {betweenLineOffset}");
     }
 }