using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
namespace Neo.Afx.Collections
{
///
/// A collection of int values that map to month name string values.
///
public class MonthCollection : ReadOnlyCollection>
{
///
/// Initializes a new instance of the class.
///
public MonthCollection()
: base(CreateList())
{
}
static List> CreateList()
{
// monthNames contains 13 elements
var monthNames = DateTimeFormatInfo.InvariantInfo.AbbreviatedMonthNames;
var options = new List>();
for(var i = 0; i < monthNames.Length - 1; i++)
{
options.Add(new KeyValuePair(i + 1, monthNames[i]));
}
return options;
}
}
}