Version

BeforeDisplayReminderDialog Event

Fired before a reminder dialog is displayed.
Syntax
'Declaration
 
Public Event BeforeDisplayReminderDialog As CancelableAppointmentEventHandler
public event CancelableAppointmentEventHandler BeforeDisplayReminderDialog
Event Data

The event handler receives an argument of type CancelableAppointmentEventArgs containing data related to this event. The following CancelableAppointmentEventArgs properties provide information specific to this event.

PropertyDescription
Appointment Returns the appointment object associated with the event. This property is read-only.
Cancel (Inherited from System.ComponentModel.CancelEventArgs) 
Remarks

The BeforeDisplayReminderDialog event may be canceled using System.ComponentModel.CancelEventArgs.Cancel property to prevent the ReminderDialog from being displayed for the specified Appointment.

The CancelableAppointmentEventArgs.Appointment property returns the Appointment whose Appointment.Reminder has been activated.

If the ReminderDialog is already displayed, the CancelableAppointmentEventArgs.Appointment will just be added to the items currently in the ReminderDialog.

Example
This example uses the Reminder object's SnoozeIntervalUnits property to determine the duration of the last "snooze". If that last snooze was Days, the event is canceled, and the snooze interval is set to 1 minute, so the user is encouraged to stop snoozing the reminder.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.Diagnostics

    Private Sub ultraCalendarInfo1_BeforeDisplayReminderDialog(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.CancelableAppointmentEventArgs) Handles ultraCalendarInfo1.BeforeDisplayReminderDialog

        '----------------------------------------------------------------------------------------------------
        '	Description
        '	BeforeDisplayReminderDialog
        '
        '	Fires before the Reminder dialog is displayed
        '	If canceled, the Reminder dialog is not displayed, and the AfterDisplayReminderDialog event does not fire.
        '
        '----------------------------------------------------------------------------------------------------

        If (e.Appointment.Reminder.SnoozeIntervalUnits = SnoozeIntervalUnits.Days) Then
            '	Cancel the event, so that the Reminder dialog is not displayed
            e.Cancel = True

            '	Get the value of the SnoozeTime property, which tells us when the
            '	appointment was last snoozed
            Dim snoozeTime As DateTime = e.Appointment.Reminder.SnoozeTime

            '	Display a stern warning regarding the virtues of promptly attending to important matters :)
            Dim info As String = String.Empty
            info += "This Reminder was last snoozed on " + snoozeTime.ToLongDateString()
            info += " at " + snoozeTime.ToLongTimeString() + vbCrLf + vbCrLf
            info += "The snooze interval will now be set to 1 minute." + vbCrLf

            MessageBox.Show(info, "BeforeDisplayReminderDialog", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End If

    End Sub
using System.Diagnostics;
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

		private void ultraCalendarInfo1_BeforeDisplayReminderDialog(object sender, Infragistics.Win.UltraWinSchedule.CancelableAppointmentEventArgs e)
		{

			//----------------------------------------------------------------------------------------------------
			//	Description
			//	BeforeDisplayReminderDialog
			//
			//	Fires before the Reminder dialog is displayed
			//	If canceled, the Reminder dialog is not displayed, and the AfterDisplayReminderDialog event does not fire.
			//
			//----------------------------------------------------------------------------------------------------

			if ( e.Appointment.Reminder.SnoozeIntervalUnits == SnoozeIntervalUnits.Days )
			{
				//	Cancel the event, so that the Reminder dialog is not displayed
				e.Cancel = true;

				//	Get the value of the SnoozeTime property, which tells us when the
				//	appointment was last snoozed
				DateTime snoozeTime = e.Appointment.Reminder.SnoozeTime;

				//	Display a stern warning regarding the virtues of promptly attending to important matters :)
				string info = string.Empty;
				info += "This Reminder was last snoozed on " + snoozeTime.ToLongDateString();
				info += " at " + snoozeTime.ToLongTimeString() + "\n\n";
				info += "The snooze interval will now be set to 1 minute." + "\n";

				MessageBox.Show( info, "BeforeDisplayReminderDialog", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
			}

		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also