5
可能重複:
When you use flag(Enum) you have a limit of 64. What are the alternative when you reach the limit?標誌枚舉有太多的項目;最後一個值過大。我該如何解決這個問題?
我有以下[Flags] enum
有包含33個元素:
[Flags]
public enum Types
{
None = 0,
Alarm = 1,
Exit = 2,
Panic = 4,
Fire = 8,
Tamper = 16,
Key = 32,
Line = 64,
FTC = 128,
Unused = 256,
tech_1 = 512,
//... tech_2 through _7 omitted for brevity
tech_8 = 65536,
fire_1 = 131072,
//... fire_2 through _11 omitted for brevity
fire_12 = 268435456,
Key = 536870912,
Exit = 1073741824,
Gas = 2147483648, // Cannot convert source type uint to target type int
}
出現的最後一個項目的值過大。有沒有人處理過這個?任何想法如何能解決/合作周圍?
a loooong enum .. – 2012-04-20 09:29:12