Skip to main content

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.v24.1.Core.Desktop.dll

NuGet Package: DevExpress.Scheduler.CoreDesktop

Declaration

public TimeInterval FindFreeTimeInterval(
    TimeInterval interval,
    Resource resource,
    TimeSpan duration,
    bool forward
)

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