Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Private Sub SnoozeReminder()
' If there are no appointments, create one now
Dim appointment As Appointment = Nothing
If Me.ultraCalendarInfo1.Appointments.Count = 0 Then
appointment = Me.ultraCalendarInfo1.Appointments.Add(DateTime.Now.AddMinutes(2.0F), DateTime.Now.AddMinutes(5.0F), "My Appointment")
Else
' There is already an appointment, so we will use it
appointment = Me.ultraCalendarInfo1.Appointments(0)
' Adjust the start and end time
appointment.StartDateTime = DateTime.Now.AddMinutes(1.0F)
appointment.EndDateTime = appointment.StartDateTime.AddMinutes(5.0F)
End If
' Get the appointment's reminder object
Dim reminder As Reminder = appointment.Reminder
' Check the Snoozed property to see if the reminder has already been snoozed
If reminder.Snoozed Then
' Get the time at which it was snoozed
Dim snoozeTime As DateTime = reminder.SnoozeTime
' Notify the user that the reminder has been snoozed
MessageBox.Show("This reminder has already been snoozed at " + snoozeTime.ToString("t") + ". Stop procrastinating!", "SnoozeReminder", MessageBoxButtons.OK)
Return
Else
' Set the SnoozeIntervalUnits to minutes, since that is the
' unit of time that was specified
reminder.SnoozeIntervalUnits = SnoozeIntervalUnits.Minutes
' Snooze the reminder for one minute by setting the
' SnoozeInterval property
reminder.SnoozeInterval = 1
' Call the snooze method
reminder.Snooze(reminder.SnoozeIntervalUnits, reminder.SnoozeInterval)
End If
End Sub