Skip to main content

IAppointmentStorageBase.AddRange(Appointment[]) Method

Appends an array of appointments to the storage.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.Core.dll

Declaration

void AddRange(
    Appointment[] items
)

Parameters

Name Type Description
items Appointment[]

An array of Appointment objects to append to the storage’s 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