Click or drag to resize

TimeIntervalCollectionTAdd Method (TimeIntervalT, IEqualityComparerT)

Adds an interval to the interval collection. If the interval or a portion of the interval already exists in the collection, the Data from item will replace the data already in the collection.

Namespace:  AGI.Foundation.Time
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.1.418.0 (24.1.418.0)
Syntax
public void Add(
	TimeInterval<T> item,
	IEqualityComparer<T> dataComparer
)

Parameters

item
Type: AGI.Foundation.TimeTimeIntervalT
The interval to add.
dataComparer
Type: System.Collections.GenericIEqualityComparerT
The object to use to compare the Data properties of intervals.
Exceptions
ExceptionCondition
ObjectFrozenException Thrown when the this TimeIntervalCollection is read-only.
Remarks
dataComparer is used to compare the Data properties of the intervals. If item overlaps any intervals already in the collection, the Data property from item takes precedence and replaces the existing Data for the interval of overlap.
See Also