Search
Calendar.RecurringItemDeleting Event
See Also
 






Raised when the user is about to delete a recurring item.

Namespace: MindFusion.Scheduling
Assembly: MindFusion.Scheduling

 Syntax

C#  Copy Code

public event EventHandler<RecurringItemConfirmEventArgs> RecurringItemDeleting

Visual Basic  Copy Code

Public Event RecurringItemDeleting As EventHandler(Of RecurringItemConfirmEventArgs)

 Event Data

RecurringItemDeleting event handlers receive an argument of type RecurringItemConfirmEventArgs.

 Remarks

This event can be used to prevent the deletion of recurring items. For non-recurring items, handle the ItemDeleting event.

 Example

The following example demonstrates how to use RecurringItemDeleting event to ask the user whether he or she wants to delete all items of a recurring pattern or only the selected item(s). The example assumes that calendar already references a Calendar control. The method ConfirmDelete is supposed to return 0 if the user cancels the deletion of the item, 1 if the user chooses that only the selected item is to be deleted, and 2 if the user wants to delete the entire pattern.

C#  Copy Code

// Attach a handler to the event
calendar.RecurringItemDeleting +=
    new EventHandler<RecurringItemConfirmEventArgs>(calendar_RecurringItemDeleting);

// ...

private void calendar_RecurringItemDeleting(object sender, RecurringItemConfirmEventArgs e)
{
    int result = ConfirmDelete(e.Item);

    switch (result)
    {

        case 0:
            // Do nothing
            break;

        case 1:
            e.ConfirmOccurrence = true;
            break;

        case 2:
            e.ConfirmAll = true;
            break;

    }
}

Visual Basic  Copy Code

' Attach a handler to the event
AddHandler calendar.RecurringItemDeleting, AddressOf calendar_RecurringItemDeleting

' ...

Private Sub calendar_RecurringItemDeleting(ByVal sender As Object, ByVal e As RecurringItemConfirmEventArgs)

    Dim result As Integer = ConfirmDelete(e.Item)

    Select Case result

        Case 0
            ' Do nothing

        Case 1
            e.ConfirmOccurrence = True

        Case 2
            e.ConfirmAll = True

    End Select

End Sub

 See Also