Version

OnBeforeDisplayReminderDialog Method

Raises the BeforeDisplayReminderDialog event before a ReminderDialog is displayed for an Appointment.
Syntax
'Declaration
 
Protected Overridable Sub OnBeforeDisplayReminderDialog( _
   ByVal e As CancelableAppointmentEventArgs _
) 
protected virtual void OnBeforeDisplayReminderDialog( 
   CancelableAppointmentEventArgs e
)

Parameters

e
A CancelableAppointmentEventArgs that provides data for the event.
Remarks

Raising an event invokes the event handler through a delegate.

The OnBeforeDisplayReminderDialog method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors: When overriding OnBeforeDisplayReminderDialog in a derived class, be sure to call the base class's OnBeforeDisplayReminderDialog method so that registered delegates receive the event.

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