我可以将FlagsAttribute应用于从类型库导入的枚举吗?

时间:2017-03-24 14:06:14

标签: c# enums com idl typelib

在C#中有FlagsAttribute

之类的东西
[Flags]
public enum Options 
{
    None = 0,
    Option1 = 1,
    Option2 = 2,
    Option3 = 4,
}

但看起来无论何时在IDL中声明枚举并进入类型库并稍后使用tlbimp导入它,它最终都是en enum而不是FlagsAttribute,即使它包含具有互斥位模式的值。 / p>

是否有可能以某种方式在IDL中声明枚举,以便在互操作程序集中应用FlagsAttribute

0 个答案:

没有答案