'Declaration Public Class AppointmentsCollection Inherits Infragistics.Shared.SubObjectsCollectionBase
public class AppointmentsCollection : Infragistics.Shared.SubObjectsCollectionBase
The AppointmentsCollection contains a reference to all the Appointment objects for the UltraCalendarInfo object and can be accessed via the UltraCalendarInfo.Appointments property.
The UltraCalendarInfo.SelectedAppointments collection can be used to retrieve only the appointments that are currently selected. The appointments associated with a particular time frame may be returned in a AppointmentsSubsetCollection object.
Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports System.IO Imports System.Globalization Private Sub AddAppointment(ByVal appointmentDate As DateTime, ByVal subject As String, ByVal fireEvents As Boolean) ' Determine whether the AfterAppointmentAdded event is enabled Dim beforeWasEnabled As Boolean = Me.ultraCalendarInfo1.EventManager.IsEnabled(CalendarInfoEventIds.BeforeAppointmentAdded) Dim afterWasEnabled As Boolean = Me.ultraCalendarInfo1.EventManager.IsEnabled(CalendarInfoEventIds.AfterAppointmentAdded) ' If the 'before' event was enabled, and the 'fireEvents' parameter is false, ' prevent the event from firing by disabling it If (beforeWasEnabled And Not fireEvents) Then Me.ultraCalendarInfo1.EventManager.SetEnabled(CalendarInfoEventIds.BeforeAppointmentAdded, False) End If ' If the 'after' event was enabled, and the 'fireEvents' parameter is false, ' prevent the event from firing by disabling it If (afterWasEnabled And Not fireEvents) Then Me.ultraCalendarInfo1.EventManager.SetEnabled(CalendarInfoEventIds.AfterAppointmentAdded, False) End If ' Add the appointment Me.ultraCalendarInfo1.Appointments.Add(appointmentDate, subject) ' Now re-enable the event firings, but only if they were not already disabled ' before this method was called. ' If the 'before' event was enabled, re-enable it now that we have added the appointment If (beforeWasEnabled And Not fireEvents) Then Me.ultraCalendarInfo1.EventManager.SetEnabled(CalendarInfoEventIds.BeforeAppointmentAdded, True) End If ' If the 'after' event was enabled, re-enable it now that we have added the appointment If (afterWasEnabled And Not fireEvents) Then Me.ultraCalendarInfo1.EventManager.SetEnabled(CalendarInfoEventIds.AfterAppointmentAdded, True) End If End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using System.IO; using System.Globalization; private void AddAppointment( DateTime appointmentDate, string subject, bool fireEvents ) { // Determine whether the AfterAppointmentAdded event is enabled bool beforeWasEnabled = this.ultraCalendarInfo1.EventManager.IsEnabled( CalendarInfoEventIds.BeforeAppointmentAdded ); bool afterWasEnabled = this.ultraCalendarInfo1.EventManager.IsEnabled( CalendarInfoEventIds.AfterAppointmentAdded ); // If the 'before' event was enabled, and the 'fireEvents' parameter is false, // prevent the event from firing by disabling it if ( beforeWasEnabled && ! fireEvents ) this.ultraCalendarInfo1.EventManager.SetEnabled( CalendarInfoEventIds.BeforeAppointmentAdded, false ); // If the 'after' event was enabled, and the 'fireEvents' parameter is false, // prevent the event from firing by disabling it if ( afterWasEnabled && ! fireEvents ) this.ultraCalendarInfo1.EventManager.SetEnabled( CalendarInfoEventIds.AfterAppointmentAdded, false ); // Add the appointment this.ultraCalendarInfo1.Appointments.Add( appointmentDate, subject ); // Now re-enable the event firings, but only if they were not already disabled // before this method was called. // If the 'before' event was enabled, re-enable it now that we have added the appointment if ( beforeWasEnabled && ! fireEvents ) this.ultraCalendarInfo1.EventManager.SetEnabled( CalendarInfoEventIds.BeforeAppointmentAdded, true ); // If the 'after' event was enabled, re-enable it now that we have added the appointment if ( afterWasEnabled && ! fireEvents ) this.ultraCalendarInfo1.EventManager.SetEnabled( CalendarInfoEventIds.AfterAppointmentAdded, true ); }
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