A newer version of this page is available. Switch to the current version.

FreeTimeCalculator.FindFreeTimeInterval(TimeInterval, Resource, TimeSpan, Boolean) Method

Performs a search for the time slot with the specified minimum duration within the specified interval, and assigned to the specified resource.

Namespace: DevExpress.XtraScheduler.Tools

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

Declaration

public TimeInterval FindFreeTimeInterval(
    TimeInterval interval,
    Resource resource,
    TimeSpan duration,
    bool forward
)
Public Function FindFreeTimeInterval(
    interval As TimeInterval,
    resource As Resource,
    duration As TimeSpan,
    forward As Boolean
) As TimeInterval

Parameters

Name Type Description
interval TimeInterval

A TimeInterval object, representing the time period in which the search is performed.

resource Resource

A Resource of the appointments taken into account when the search is performed.

duration TimeSpan

A TimeSpan structure, which represents the duration of a time slot to find.

forward Boolean

If true, the search starts at the interval.Start and continues forward in time. If false, it starts at interval.End, and continues backwards.

Returns

Type Description
TimeInterval

A TimeInterval object, representing the interval which meets the conditions, or the TimeInterval.Empty value, if an interval is not found.

Remarks

The FindFreeTimeInterval method searches for the nearest free interval with a specified duration or longer, within the specified period. Only appointments assigned to the specified resource are considered.

To see an example, refer to the description of the FreeTimeCalculator class.

See Also