Code is working as expected, you are finding a previously registered reminder, when it exists, you remove it and then register a new one with the same name.
separate your code into a simple method
private void RegisterScheduleIfNotExist(string name, string title, string content, DateTime time)
{
ScheduledAction currentReminder = ScheduledActionService.Find(name);
if (currentReminder != null)
{
ScheduledActionService.Remove(currentReminder.Name);
}
var reminder = new Reminder(name)
{
BeginTime = time,
Title = title,
Content = content,
};
ScheduledActionService.Add(reminder);
}
then call the method with Unique names IF you do not wish to override an existing reminder, e.g.with Task1, Task2
RegisterScheduleIfNotExist("Task1", "Task 1 title", "Task 1 content", DateTime.Now.AddMinutes(3));
RegisterScheduleIfNotExist("Task2", "Task 2 title", "Task 2 content", DateTime.Now.AddMinutes(5));