Version

Add(TimeSpan,TimeSpan) Method

Adds a new TimeRange instance to this collection with the specified startTime and endTime.
Syntax
'Declaration
 
Public Overloads Function Add( _
   ByVal startTime As TimeSpan, _
   ByVal endTime As TimeSpan _
) As TimeRange
public TimeRange Add( 
   TimeSpan startTime,
   TimeSpan endTime
)

Parameters

startTime
The start time for the new instance
endTime
The end time for the new instance

Return Value

The resulting TimeRange instance.
Exceptions
ExceptionDescription
System.ExceptionThrown if either parameter is negative, or exceeds a value of 24 hours.
Remarks

If the values of the startTime and endTime parameters define a range of time which intersects with an existing member of this collection, the existing member is modified to incorporate the new range, but no new member is added, and the existing instance is returned.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also