public ReminderCurrentUc(Reminder reminder) { InitializeComponent(); _reminder = reminder; _reminder.RefreshTimer += OnRefreshTimer; nameLbl.Text = _reminder.Name; timeLbl.Text = _reminder.GetRemainingTime().ToString(); }
private void OnRefreshTimer(object sender, ReminderEventArgs e) { var remainingTime = _reminder.GetRemainingTime(); if (remainingTime == _reminder.Interval - 1 || remainingTime == -1) // Repeats or is done { RefreshReminders?.Invoke(sender, e); } timeLbl.Text = remainingTime.ToString(); }