'Declaration Public Class Appointment Inherits ActivityBase Implements Infragistics.Shared.ISelectableItem
public class Appointment : ActivityBase, Infragistics.Shared.ISelectableItem
An Appointment object maintains information regarding a task for a particular date and time. The start and end of the appointment are stored in the StartDateTime or EndDateTime respectively. To change the start of the appointment without changing the duration, use the OffsetStartTime method.
The AllDayEvent property may be used to indicate that an Appointment occurs on a day or range of days but is not restricted to a particular time within those days. By default, AllDayEvent appointments are rendered differently than non-AllDayEvent appointments. The appearance of all AllDayEvent type appointments can be adjusted by changing the UltraCalendarLook.AllDayEventAppearance. The UltraCalendarLook.AppointmentAppearance can be used to change the appearance for all appointments. The appearance of an appointment can also be controlled on an individual basis by adjusting its Appearance
A new Appointment, can be created by either creating a new instance of an Appointment Constructor(DateTime,DateTime) and adding it to the UltraCalendarInfo.Appointments collection or using the AppointmentsCollection.Add method of the collection. An appointment can also be created using the AppointmentDialog. To display the AppointmentDialog for a new appointment, use the UltraCalendarInfo.DisplayAppointmentDialog. The UltraCalendarInfo.DisplayAppointmentDialog overload may be used to display the appointment information for an existing Appointment.
An Appointment can have a Reminder and AppointmentAction associated with it. When the StartDateTime is reached, the Reminder will be displayed and the Action will be invoked as long as each is enabled.
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