Class TimeInterval
Encapsulates implementations of the ITimeInterval interface and helper methods for it.
Inheritance
Inherited Members
Namespace: Alpaca.Markets
Assembly: Alpaca.Markets.dll
Syntax
public static class TimeInterval
Methods
| Improve this Doc View SourceDeconstruct(IExclusiveTimeInterval, out Nullable<DateTime>, out Nullable<DateTime>)
Deconstructs the IExclusiveTimeInterval instance
into two
Declaration
public static void Deconstruct(IExclusiveTimeInterval interval, out DateTime? from, out DateTime? into)
Parameters
Type | Name | Description |
---|---|---|
IExclusiveTimeInterval | interval | Original time interval. |
System.Nullable<DateTime> | from | Time interval starting point. |
System.Nullable<DateTime> | into | Time interval ending point. |
Deconstruct(IInclusiveTimeInterval, out Nullable<DateTime>, out Nullable<DateTime>)
Deconstructs the IInclusiveTimeInterval instance
into two
Declaration
public static void Deconstruct(IInclusiveTimeInterval interval, out DateTime? from, out DateTime? into)
Parameters
Type | Name | Description |
---|---|---|
IInclusiveTimeInterval | interval | Original time interval. |
System.Nullable<DateTime> | from | Time interval starting point. |
System.Nullable<DateTime> | into | Time interval ending point. |
GetExclusiveIntervalFromThat(DateTime)
Gets exclusive open time interval starting from the value
date/time point.
Declaration
public static IExclusiveTimeInterval GetExclusiveIntervalFromThat(DateTime value)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Starting date/time point for filtering. |
Returns
Type | Description |
---|---|
IExclusiveTimeInterval | Inclusive open time interval. |
GetExclusiveIntervalTillThat(DateTime)
Gets exclusive open time interval ending at the value
date/time point.
Declaration
public static IExclusiveTimeInterval GetExclusiveIntervalTillThat(DateTime value)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Ending date/time point for filtering. |
Returns
Type | Description |
---|---|
IExclusiveTimeInterval | Inclusive open time interval. |
GetInclusiveIntervalFromThat(DateTime)
Gets inclusive open time interval starting from the value
date/time point.
Declaration
public static IInclusiveTimeInterval GetInclusiveIntervalFromThat(DateTime value)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Starting date/time point for filtering. |
Returns
Type | Description |
---|---|
IInclusiveTimeInterval | Inclusive open time interval. |
GetInclusiveIntervalTillThat(DateTime)
Gets inclusive open time interval ending at the value
date/time point.
Declaration
public static IInclusiveTimeInterval GetInclusiveIntervalTillThat(DateTime value)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Ending date/time point for filtering. |
Returns
Type | Description |
---|---|
IInclusiveTimeInterval | Inclusive open time interval. |
IsEmpty(ITimeInterval)
Gets boolean flag signals that time interval is empty (both start and end date equal to null
).
Declaration
public static Boolean IsEmpty(this ITimeInterval interval)
Parameters
Type | Name | Description |
---|---|---|
ITimeInterval | interval | Target time interval for checking. |
Returns
Type | Description |
---|---|
Boolean |
IsOpen(ITimeInterval)
Gets boolean flag signals that time interval is open (both start or end date equal to null
).
Declaration
public static Boolean IsOpen(this ITimeInterval interval)
Parameters
Type | Name | Description |
---|---|---|
ITimeInterval | interval | Target time interval for checking. |
Returns
Type | Description |
---|---|
Boolean |
SetExclusiveTimeInterval<TRequest>(TRequest, DateTime, DateTime)
Set exclusive time interval for request
object.
Declaration
public static TRequest SetExclusiveTimeInterval<TRequest>(this TRequest request, DateTime from, DateTime into)
where TRequest : IRequestWithTimeInterval<IExclusiveTimeInterval>
Parameters
Type | Name | Description |
---|---|---|
TRequest | request | Target request for setting filtering interval. |
DateTime | from | Starting date/time point for filtering. |
DateTime | into | Ending date/time point for filtering. |
Returns
Type | Description |
---|---|
TRequest | Fluent interface - returns |
Type Parameters
Name | Description |
---|---|
TRequest |
SetInclusiveTimeInterval<TRequest>(TRequest, DateTime, DateTime)
Set inclusive time interval for request
object.
Declaration
public static TRequest SetInclusiveTimeInterval<TRequest>(this TRequest request, DateTime from, DateTime into)
where TRequest : IRequestWithTimeInterval<IInclusiveTimeInterval>
Parameters
Type | Name | Description |
---|---|---|
TRequest | request | Target request for setting filtering interval. |
DateTime | from | Starting date/time point for filtering. |
DateTime | into | Ending date/time point for filtering. |
Returns
Type | Description |
---|---|
TRequest | Fluent interface - returns |
Type Parameters
Name | Description |
---|---|
TRequest |
SetTimeInterval<TRequest>(TRequest, IExclusiveTimeInterval)
Set exclusive time interval for request
object.
Declaration
public static TRequest SetTimeInterval<TRequest>(this TRequest request, IExclusiveTimeInterval interval)
where TRequest : IRequestWithTimeInterval<IExclusiveTimeInterval>
Parameters
Type | Name | Description |
---|---|---|
TRequest | request | Target request for setting filtering interval. |
IExclusiveTimeInterval | interval | Time interval (date/time pair) for filtering. |
Returns
Type | Description |
---|---|
TRequest | Fluent interface - returns |
Type Parameters
Name | Description |
---|---|
TRequest |
SetTimeInterval<TRequest>(TRequest, IInclusiveTimeInterval)
Set inclusive time interval for request
object.
Declaration
public static TRequest SetTimeInterval<TRequest>(this TRequest request, IInclusiveTimeInterval interval)
where TRequest : IRequestWithTimeInterval<IInclusiveTimeInterval>
Parameters
Type | Name | Description |
---|---|---|
TRequest | request | Target request for setting filtering interval. |
IInclusiveTimeInterval | interval | Time interval (date/time pair) for filtering. |
Returns
Type | Description |
---|---|
TRequest | Fluent interface - returns |
Type Parameters
Name | Description |
---|---|
TRequest |
WithFrom(IExclusiveTimeInterval, DateTime)
Creates new instance of IExclusiveTimeInterval object with the modified From property value.
Declaration
public static IExclusiveTimeInterval WithFrom(this IExclusiveTimeInterval interval, DateTime from)
Parameters
Type | Name | Description |
---|---|---|
IExclusiveTimeInterval | interval | Original time interval. |
DateTime | from | New starting date/time point for interval. |
Returns
Type | Description |
---|---|
IExclusiveTimeInterval | The new instance of IExclusiveTimeInterval object. |
WithFrom(IInclusiveTimeInterval, DateTime)
Creates new instance of IInclusiveTimeInterval object with the modified From property value.
Declaration
public static IInclusiveTimeInterval WithFrom(this IInclusiveTimeInterval interval, DateTime from)
Parameters
Type | Name | Description |
---|---|---|
IInclusiveTimeInterval | interval | Original time interval. |
DateTime | from | New starting date/time point for interval. |
Returns
Type | Description |
---|---|
IInclusiveTimeInterval | The new instance of IInclusiveTimeInterval object. |
WithInto(IExclusiveTimeInterval, DateTime)
Creates new instance of IExclusiveTimeInterval object with the modified Into property value.
Declaration
public static IExclusiveTimeInterval WithInto(this IExclusiveTimeInterval interval, DateTime into)
Parameters
Type | Name | Description |
---|---|---|
IExclusiveTimeInterval | interval | Original time interval. |
DateTime | into | New ending date/time point for interval. |
Returns
Type | Description |
---|---|
IExclusiveTimeInterval | The new instance of IExclusiveTimeInterval object. |
WithInto(IInclusiveTimeInterval, DateTime)
Creates new instance of IInclusiveTimeInterval object with the modified Into property value.
Declaration
public static IInclusiveTimeInterval WithInto(this IInclusiveTimeInterval interval, DateTime into)
Parameters
Type | Name | Description |
---|---|---|
IInclusiveTimeInterval | interval | Original time interval. |
DateTime | into | New ending date/time point for interval. |
Returns
Type | Description |
---|---|
IInclusiveTimeInterval | The new instance of IInclusiveTimeInterval object. |