我知道我可以成倍增加,但我不想做懒惰的编程。
有没有人设计了一些魔法来自动将枚举编号为 2 的幂?
这是我要使其具体化的示例:
[Flags]
private enum Targets : uint
{
None = 0,
Campaigns = 1,
CampaignGroups = 2,
Advertisers = 4,
AdvertiserGroups = 8,
AffiliateGroups = 16,
Affiliates = 32,
Creatives = 64,
DetailedLeads = 128,
DetailedSales = 256,
ProgramLeads = 512,
CreativeDeployments = 1024,
CampaignCategories = 2048,
Payouts = 4096,
All = uint.MaxValue
}