Skip to main content

AppointmentStorageBase.AddRange(Appointment[]) Method

Appends an array of appointments to the storage’s collection.

Namespace: DevExpress.XtraScheduler

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

NuGet Package: DevExpress.Scheduler.CoreDesktop

Declaration

public void AddRange(
    Appointment[] items
)

Parameters

Name Type Description
items Appointment[]

An array of Appointment objects to append to the collection.

Remarks

Objects are added to the end of the collection in the order they appear in the array.

The following code illustrates how to add multiple appointments in code.

int count = 10;
Appointment[] AppArray = new Appointment[count];
AppointmentCollection AppCollection = new AppointmentCollection();
for (int i=1; i<=count; i++) {
    Appointment newApp = schedulerControl.DataStorage.CreateAppointment(AppointmentType.Normal);
    newApp.Start = DateTime.Now.AddMinutes(count);
    newApp.End = DateTime.Now.AddMinutes(count * 2);
    AppCollection.Add(newApp);
}
AppCollection.CopyTo(AppArray, 0);
schedulerControl.DataStorage.BeginUpdate();
schedulerControl.DataStorage.Appointments.AddRange(AppArray);
schedulerControl.DataStorage.EndUpdate();
See Also