When are ParameterInfo.IsLcid or ParameterInfo.IsRetval true?

后端 未结 1 1658
遇见更好的自我
遇见更好的自我 2021-01-13 03:30

I find this question in Stack Overflow when googleing, but it has been deleted. So I list this question again.

As I can\'t find the LcidAttribute or

相关标签:
1条回答
  • 2021-01-13 04:00

    They are associated with the ParameterAttributes enumeration. Which is used in metadata for the parameter of a method, only a compiler can emit the [modopt].

    I do not know of a compiler that actually does this. I have a decent guess at the background though, these attributes are also used in IDL. Which is an interface description language that is used in COM and RPC. Having this option ensures that .NET metadata can also describe the kind of declarations that are written in IDL and can appear in type libraries.

    The [lcid] attribute is described here. It doesn't actually describe usage and I've never used it myself. No real idea why you'd use it.

    The [retval] attribute is described here. Very important in COM automation method declarations, it marks the parameter that returns the method value. And used by a tool like Tlbimp.exe, it rewrites the method to make that parameter the return value type.

    0 讨论(0)
提交回复
热议问题