Search
Schedule.GetFreePeriod Method (DateTime, DateTime, TimeSpan, ResourceCollection(Resource))
See Also
 






Returns the next period after the specified date with the specified duration, which is not occupied by items associated with the specified resources.

Namespace: MindFusion.Scheduling
Assembly: MindFusion.Scheduling

 Syntax

C#  Copy Code

public DateTime GetFreePeriod (
    DateTime from,
    DateTime to,
    TimeSpan duration,
    ResourceCollection<Resource> resources
)

Visual Basic  Copy Code

Public Function GetFreePeriod( _
    from As DateTime, _
    to As DateTime, _
    duration As TimeSpan, _
    resources As ResourceCollection(Of Resource) _
) As DateTime

 Parameters

from

The start date of the interval in which to search for a free period.

to

The end date of the interval in which to search for a free period.

duration

The required minimum duration of the period.

resources

The resources whose items should be considered when looking for the free period.

 Return Value

A DateTime object representing the start time of the period found or DateTime.MinValue if none.

 Remarks

If there are recurring items associated with a resource in the specified collection, the function execution might take very long if a period with the specified duration doesn't exist.

 See Also