main
1using System;
2using System.Collections.Generic;
3using System.Linq;
4
5namespace MoMoney.Domain.Core
6{
7 public static class Months
8 {
9 static readonly IList<IMonth> all_months = new List<IMonth>();
10
11 public static readonly IMonth January = new Month(01, "January");
12 public static readonly IMonth February = new Month(02, "February");
13 public static readonly IMonth March = new Month(03, "March");
14 public static readonly IMonth April = new Month(04, "April");
15 public static readonly IMonth May = new Month(05, "May");
16 public static readonly IMonth June = new Month(06, "June");
17 public static readonly IMonth July = new Month(07, "July");
18 public static readonly IMonth August = new Month(08, "August");
19 public static readonly IMonth September = new Month(09, "September");
20 public static readonly IMonth October = new Month(10, "October");
21 public static readonly IMonth November = new Month(11, "November");
22 public static readonly IMonth December = new Month(12, "December");
23
24 public static IMonth that_represents(DateTime the_underlying_date)
25 {
26 return all_months.Single(x => x.represents(the_underlying_date));
27 }
28
29 public static void add(IMonth month)
30 {
31 all_months.Add(month);
32 }
33 }
34}