是否有可能将多个属性在F#? [英] Is It Possible To Combine Multiple Attributes In F#?
本文介绍了是否有可能将多个属性在F#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图找出F#这相当于C#属性delclaration的:
I'm trying to figure out the F# equivalent of this C# Attribute delclaration:
[
ComImport(),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
Guid("000214EE-0000-0000-C000-000000000046")
]
我能做到这一点,它编译罚款:
I can do this and it compiles fine:
[<ComImport>]
[<InterfaceType(ComInterfaceType.InterfaceIsIUnknown)>]
[<Guid("000214EE-0000-0000-C000-000000000046")>]
不过,我现在很好奇 - 这可能将多个属性在F#结合?当我尝试这样的事情前两个属性:
But I am curious now--is it possible to combine multiple attributes in F#? When I try something like this for the first two attributes:
[<ComImport>,<InterfaceType(ComInterfaceType.InterfaceIsIUnknown)>]
我得到一个FS0010错误。也试过这样:
I get an FS0010 error. Also tried this:
[<ComImport , InterfaceType(ComInterfaceType.InterfaceIsIUnknown)>]
同样的结果。
这是可能的,如果是有什么正确的语法?
Is this possible and if so what's the correct syntax?
推荐答案
是
[<
ComImport;
InterfaceType(ComInterfaceType.InterfaceIsIUnknown);
Guid("000214EE-0000-0000-C000-000000000046")
>]
这篇关于是否有可能将多个属性在F#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文