29 lines
802 B
C#
Executable File
29 lines
802 B
C#
Executable File
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections;
|
|
using System.Text;
|
|
|
|
namespace MarketData.Utils
|
|
{
|
|
public class DateRange : List<DateTime>
|
|
{
|
|
public DateRange(DateTime startDate,DateTime endDate)
|
|
{
|
|
startDate = startDate.Date;
|
|
endDate=endDate.Date;
|
|
DateGenerator dateGenerator=new DateGenerator();
|
|
List<DateTime> dates= dateGenerator.GenerateHistoricalDates(startDate, endDate);
|
|
foreach (DateTime date in dates) Add(date);
|
|
Sort(); // ensure that no matter how we set this up, the oldest date winds up being at the lowest index of the list
|
|
}
|
|
public DateTime StartDate
|
|
{
|
|
get { return this[0]; }
|
|
}
|
|
public DateTime EndDate
|
|
{
|
|
get { return this[Count-1]; }
|
|
}
|
|
}
|
|
}
|