Back to Devexpress

AppointmentStorageBase.Add(Appointment) Method

corelibraries-devexpress-dot-xtrascheduler-dot-appointmentstoragebase-dot-add-x28-devexpress-dot-xtrascheduler-dot-appointment-x29.md

latest6.6 KB
Original Source

AppointmentStorageBase.Add(Appointment) Method

Appends the specified Appointment object to the collection which can be accessed via the storage’s AppointmentStorageBase.Items property.

Namespace : DevExpress.XtraScheduler

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

NuGet Package : DevExpress.Scheduler.CoreDesktop

Declaration

csharp
public int Add(
    Appointment apt
)
vb
Public Function Add(
    apt As Appointment
) As Integer

Parameters

NameTypeDescription
aptAppointment

An Appointment object to append to the collection.

|

Returns

TypeDescription
Int32

An integer value indicating the position at which the new element was inserted.

|

Remarks

This method adds an Appointment object to the end of the appointment collection maintained by the current AppointmentStorageBase object. This collection can be accessed via the storage’s AppointmentStorageBase.Items property.

To prevent excessive updates when changes to the appointment collection are applied, enclose the code that uses the Add method within calls to SchedulerStorage.BeginUpdate and SchedulerStorage.EndUpdate methods.

Tip

To perform the same action at the appointment collection level, use the collection’s AppointmentCollection.Add method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(Appointment) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-scheduler-recurrence-series-occurrencecalculator/CS/OccurrenceCalculatorSample/Form1.cs#L35

csharp
apt.RecurrenceInfo.OccurrenceCount = 5;
    schedulerStorage1.Appointments.Add(apt);
}

winforms-scheduler-display-custom-tooltips/CS/Form1.cs#L101

csharp
schedulerStorage.Appointments.Add(apt);

asp-net-web-forms-scheduler-copy-paste-appointment-context-menu-items/CS/WebApplication1/Default.aspx.cs#L110

csharp
ASPxScheduler1.Storage.Appointments.Add(newAppointment);
ASPxScheduler1.JSProperties["cpCallBackParameter"] = "PasteAppointment";

how-to-display-a-warning-tooltip-when-dragging-an-appointment-to-forbidden-area-e1062/CS/Form1.cs#L36

csharp
apt.Subject = "Sample Appointment";
this.schedulerStorage1.Appointments.Add(apt);
this.schedulerControl1.ActiveViewType = SchedulerViewType.Day;

winforms-scheduler-recurrence-series-occurrencecalculator/VB/OccurrenceCalculatorSample/Form1.vb#L33

vb
apt.RecurrenceInfo.OccurrenceCount = 5
    schedulerStorage1.Appointments.Add(apt)
End Sub

winforms-scheduler-display-custom-tooltips/VB/Form1.vb#L84

vb
apt.CustomFields("cfPrice") = 10
schedulerStorage.Appointments.Add(apt)
schedulerControl1.Start = baseTime

winforms-scheduler-hit-testing/VB/HitTest/Form1.vb#L29

vb
apt.LabelKey = 3
    schedulerStorage1.Appointments.Add(apt)
End Sub

asp-net-web-forms-scheduler-copy-paste-appointment-context-menu-items/VB/WebApplication1/Default.aspx.vb#L111

vb
newAppointment.End = newAppointment.Start + sourceAppointment.Duration
ASPxScheduler1.Storage.Appointments.Add(newAppointment)
ASPxScheduler1.JSProperties("cpCallBackParameter") = "PasteAppointment"

winforms-scheduler-import-google-calendar/VB/GoogleCalendarExample/CalendarImporter.vb#L51

vb
AssignCommonPropertiesTo(appointment, item)
    Storage.Appointments.Add(appointment)
Next item

Implements

Add(Appointment)

See Also

AppointmentStorageBase Class

AppointmentStorageBase Members

DevExpress.XtraScheduler Namespace