Raising an event invokes the event handler through a delegate.
The OnAfterAppointmentRemoved 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 OnAfterAppointmentRemoved in a derived class, be sure to call the base class's OnAfterAppointmentRemoved method so that registered delegates receive the event.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports System.Diagnostics Private Sub ultraCalendarInfo1_AfterAppointmentRemoved(ByVal sender As Object, ByVal e As System.EventArgs) Handles ultraCalendarInfo1.AfterAppointmentRemoved '---------------------------------------------------------------------------------------------------- ' Description ' AfterAppointmentRemoved ' ' Fires after an existing member is removed from the component's Appointments collection ' '---------------------------------------------------------------------------------------------------- Dim result As DialogResult = MessageBox.Show("An Appointment was just removed from the UltraCalendarInfo object." + "\n" + "Would you like to add a new Appointment for the ActiveDay?", "AfterAppointmentRemoved", MessageBoxButtons.YesNo) If (result = DialogResult.No) Then Return Dim startTime As DateTime = Me.ultraCalendarInfo1.ActiveDay.Date.Date.AddHours(9.0F) Dim endTime As DateTime = startTime.AddMinutes(30.0F) Me.ultraCalendarInfo1.Appointments.Add(startTime, endTime, "My Appointment") End Sub
using System.Diagnostics; using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; private void ultraCalendarInfo1_AfterAppointmentRemoved(object sender, System.EventArgs e) { //---------------------------------------------------------------------------------------------------- // Description // AfterAppointmentRemoved // // Fires after an existing member is removed from the component's Appointments collection // //---------------------------------------------------------------------------------------------------- DialogResult result = MessageBox.Show( "An Appointment was just removed from the UltraCalendarInfo object." + "\n" + "Would you like to add a new Appointment for the ActiveDay?", "AfterAppointmentRemoved", MessageBoxButtons.YesNo ); if ( result == DialogResult.No ) return; DateTime startTime = this.ultraCalendarInfo1.ActiveDay.Date.Date.AddHours( 9.0F ); DateTime endTime = startTime.AddMinutes( 30.0F ); this.ultraCalendarInfo1.Appointments.Add( startTime, endTime, "My Appointment" ); }
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