Back to Devexpress

ReminderEventArgs Class

corelibraries-devexpress-dot-xtrascheduler-e279759d.md

latest5.5 KB
Original Source

ReminderEventArgs Class

Provides data for the SchedulerStorageBase.ReminderAlert event.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.Core.dll

NuGet Package : DevExpress.Scheduler.Core

Declaration

csharp
public class ReminderEventArgs :
    ReminderBaseEventArgs
vb
Public Class ReminderEventArgs
    Inherits ReminderBaseEventArgs

ReminderEventArgs is the data class for the following events:

LibraryRelated API Members
Cross-Platform Class LibraryISchedulerStorageBase.ReminderAlert
SchedulerStorageBase.ReminderAlert
WinForms ControlsSchedulerDataStorage.ReminderAlert
ASP.NET Web Forms ControlsASPxSchedulerDataWebControlBase.ReminderAlert

Remarks

The SchedulerStorageBase.ReminderAlert event occurs when a reminder alert is invoked. The ReminderEventArgs class introduces the ReminderEventArgs.AlertNotifications property that specifies the collection for all the reminder’s notifications.

An instance of the ReminderEventArgs class with appropriate settings is automatically created and passed to the corresponding event’s handler.

Example

The following example demonstrates how to manually handle reminders and perform a custom action when the SchedulerStorageBase.ReminderAlert event is fired.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/winforms-scheduler-create-appointments-on-reminder-alert

csharp
// Handle this event to perform a custom action when a reminder alert is fired.
    schedulerStorage1.ReminderAlert += SchedulerStorage1_ReminderAlert;
    // Specify the interval at which the reminder is polled for alert.
    schedulerStorage1.RemindersCheckInterval = checkInterval * 1000;
    // Hide the reminder alert window.
    schedulerControl1.OptionsBehavior.ShowRemindersForm = false;
private void SchedulerStorage1_ReminderAlert(object sender, ReminderEventArgs e) {
    // Create a new appointment.
    Appointment app = schedulerStorage1.CreateAppointment(AppointmentType.Normal);
    app.Subject = "Created on alert from appointment w/Price = " + e.AlertNotifications[0].ActualAppointment.CustomFields["CustomPrice"];
    app.Start = e.AlertNotifications[0].ActualAppointment.Start.AddHours(2);
    app.Duration = TimeSpan.FromHours(4);
    schedulerStorage1.Appointments.Add(app);

    // Modify the appointment for which the alert is triggered.
    e.AlertNotifications[0].ActualAppointment.LabelKey = 3;

    // Prevent the event from being fired one more time.
    e.AlertNotifications[0].ActualAppointment.Reminder.Dismiss();
}
vb
' Handle this event to perform a custom action when a reminder alert is fired.
    AddHandler schedulerStorage1.ReminderAlert, AddressOf SchedulerStorage1_ReminderAlert
    ' Specify the interval at which the reminder is polled for alert.
    schedulerStorage1.RemindersCheckInterval = checkInterval * 1000
    ' Hide the reminder alert window.
    schedulerControl1.OptionsBehavior.ShowRemindersForm = False
Private Sub SchedulerStorage1_ReminderAlert(ByVal sender As Object, ByVal e As ReminderEventArgs)
    ' Create a new appointment.
    Dim app As Appointment = schedulerStorage1.CreateAppointment(AppointmentType.Normal)
    app.Subject = "Created on alert from appointment w/Price = " + e.AlertNotifications(0).ActualAppointment.CustomFields("CustomPrice").ToString()
    app.Start = e.AlertNotifications(0).ActualAppointment.Start.AddHours(2)
    app.Duration = TimeSpan.FromHours(4)
    schedulerStorage1.Appointments.Add(app)

    ' Modify the appointment for which the alert is triggered.
    e.AlertNotifications(0).ActualAppointment.LabelKey = 3

    ' Prevent the event from being fired one more time.
    e.AlertNotifications(0).ActualAppointment.Reminder.Dismiss()
End Sub

Inheritance

Object EventArgs ReminderBaseEventArgs ReminderEventArgs RemindersFormDefaultActionEventArgs

See Also

ReminderEventArgs Members

ReminderAlert

DevExpress.XtraScheduler Namespace