Skip to main content

TcxCustomSchedulerStorage.FindAvailableTime(TcxSchedulerEvent,Boolean,TDateTime,TDateTime) Method

Searches for free time blocks which can be used to schedule the AEvent user event.

Declaration

function FindAvailableTime(AEvent: TcxSchedulerEvent; AExceptEventsWithoutResources: Boolean; var AStart: TDateTime; var AFinish: TDateTime): Boolean; overload;

Parameters

Name Type
AEvent TcxSchedulerEvent
AExceptEventsWithoutResources Boolean
AStart TDateTime
AFinish TDateTime

Returns

Type
Boolean

Remarks

A free time block means a period of time that does not have any other user event scheduled for it.

Use the FindAvailableTime method if overlapping user events are not allowed (the TcxSchedulerEventOperations.Intersection property is set to False).

The AStart and AFinish parameters specify the time range that the search will be performed. By default, the specified time range is extended for 30 days (the end time of it). You can change the additional time period by specifying another value for the cxMaxCheckedDuration constant.

The AllDay parameter specifies whether the user event is an all-day event.

The AResourceID parameter specifies the unique identifier of the resource, which the AEvent user event belongs to.

The AExceptEventsWithoutResources parameter specifies whether the scheduled time of the intersected user event (which is not assigned to any resource) will be treated as free time or occupied. Set the AExceptEventsWithoutResources parameter to False to skip the times scheduled by this type of user events. Note: a user event that doesn’t belong to any resource will be shown in the scheduling area if the TcxSchedulerOptionsView.ShowEventsWithoutResource property is set to True. Otherwise, it will be hidden.

The ADuration parameter specifies the desired time bounds of the user event.

The AExcludedEvent parameter specifies the user event whose scheduled time will be treated as free.

The AEvent parameter specifies the user event that will be scheduled at the available time.

The FindAvailableTime method returns a value of True if the search was successful.

See Also