public static class ExchangeBoardHelper
{
public static void ApplyHolidays2013(this ExchangeBoard board)
{
if (board == null)
throw new ArgumentNullException("board");
var holidays = new List<DateTime>();
const int year = 2013;
//https://rts.micex.ru/s690
for (var i = 1; i <= 7; i++)
holidays.Add(new DateTime(year, 1, i));
holidays.Add(new DateTime(year, 3, 8));
holidays.Add(new DateTime(year, 5, 1));
holidays.Add(new DateTime(year, 5, 9));
holidays.Add(new DateTime(year, 6, 12));
holidays.Add(new DateTime(year, 11, 4));
board.WorkingTime.SpecialHolidays = holidays.ToArray();
}
public static void ApplyHolidays2012(this ExchangeBoard board)
{
if (board == null)
throw new ArgumentNullException("board");
const int year = 2012;
//https://rts.micex.ru/a254
var holidays = new[,] { { 1, 2 }, { 2, 23 }, { 3, 8 }, { 3, 9 }, { 4, 30 }, { 5, 1 }, { 5, 9 }, { 6, 11 }, { 6, 12 }, { 11, 5 }, { 12, 31 } };
var holidayDates = new List<DateTime>();
for (var i = 0; i < holidays.GetLength(0); i++)
holidayDates.Add(new DateTime(year, holidays[i, 0], holidays[i, 1]));
board.WorkingTime.SpecialHolidays = holidayDates.ToArray();
var workingDays = new[,] { { 3, 11 }, { 4, 28 }, { 5, 5 }, { 5, 12 }, { 6, 9 } };
var workingDates = new List<DateTime>();
for (var i = 0; i < workingDays.GetLength(0); i++)
workingDates.Add(new DateTime(year, workingDays[i, 0], workingDays[i, 1]));
board.WorkingTime.SpecialWorkingDays = workingDates.ToArray();
}
}