Enum定义位域, 即可以通过位操作来产生未命名的值

 通过FlagsAttribute可以实现。 

// A bit field or flag enumeration of harvesting seasons. [Flags] public enum Seasons {     None = 0,     Summer = 1,     Autumn = 2,     Winter = 4,     Spring = 8,     All = Summer | Autumn | Winter | Spring } 

 Seasons sa = Seasons.Summer | Seasons.Autumn; 

你可能感兴趣的:(开发技术)