怎么将一个数据集保存在类中

求助:如何将一个数据集保存在类中
我有一个winform 程序,需要在多次用到月份(就是一年中的12个月)
我现在在解决方法是
在每个窗体中都写一篇如下的代码
         public class Cycle
        {
            public int id { get; set; }
            public string name { get; set; }
        }
        List<Cycle> collection = new List<Cycle>
            {
                new Cycle {id=0,name="按年发放"},
                new Cycle {id=1,name="按半年发放"},
                new Cycle {id=2,name="按季度发放"},
                new Cycle {id=3,name="按月发放"},
                new Cycle {id=4,name="不定期发放"},
            };

这样显得很菜鸟吧。有什么办法可以不用在每个窗体中这样写一遍这个东西呀


我把它写在一个单独的类中,好像不行

关键是有数据,这些数据也没有必要保存在数据中
------解决方案--------------------
x


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Cycle> cycleList = StaticList.collection;
            foreach (Cycle c in cycleList)
            {
                Console.WriteLine(c.id + " " + c.name);
            }
        }
    }
    public class Cycle
    {
        public int id { get; set; }
        public string name { get; set; }
    }

    public class StaticList
    {
        public static List<Cycle> collection = new List<Cycle>
        {
            new Cycle {id=0,name="按年发放"},
            new Cycle {id=1,name="按半年发放"},
            new Cycle {id=2,name="按季度发放"},
            new Cycle {id=3,name="按月发放"},
            new Cycle {id=4,name="不定期发放"},
        };
    }
}

------解决方案--------------------
Class1.collection
------解决方案--------------------
晕,楼主多看几页书就可以了
------解决方案--------------------
引用:
Quote: 引用:

cmbbatch.DataSource =Class1.collection

这样不行呀

怎么不行
------解决方案--------------------
          comboBox1.DataSource = Class1.collection;
            comboBox1.DisplayMember = "name";
          
------解决方案--------------------
C# 编程指南
    类和结构(C# 编程指南)
        静态类和静态类成员(C# 编程指南)
     
------解决方案--------------------
引用:
Quote: 引用:

cmbbatch.DataSource =Class1.collection

这样不行呀


string[] strArray = new string[]{"按半年发放","按季度发放","按月发放","不定期发放"};
cmbbatch.Items.AddRange(strArray );