Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.Diagnostics
Private Sub ultraCalendarInfo1_BeforeRecurringAppointmentDeleted(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.BeforeRecurringAppointmentDeletedEventArgs) Handles ultraCalendarInfo1.BeforeRecurringAppointmentDeleted
' The 'BeforeRecurringAppointmentDeleted' is invoked before a
' recurring appointment is deleted and provides a chance to
' prevent the deletion or modify what the user is deleting.
'
' The 'RecurrenceEditType' parameter is used to determine
' what will be deleted. When left to the default of 'UserSelect',
' the user will be prompted whether they would like to
' delete the individual occurrence or the entire series.
' This property can also be changed here to prevent that prompt.
' The following code only allows the user to remove
' occurances of a recurring appointment unless the
' appointment has not begun yet.
'
If e.Appointment.StartDateTime > DateTime.Now Then
e.RecurrenceEditType = RecurrenceEditType.Series
Else
e.RecurrenceEditType = RecurrenceEditType.Occurrence
End If
' To prevent the deletion of the appointment, set the
' 'Cancel' parameter to true
If e.Recurrence.PatternFrequency = RecurrencePatternFrequency.Yearly Then
e.Cancel = True
End If
End Sub