如果是ParameterInfo.IsLcid或ParameterInfo.IsRetval真的吗? [英] When are ParameterInfo.IsLcid or ParameterInfo.IsRetval true?

查看:474
本文介绍了如果是ParameterInfo.IsLcid或ParameterInfo.IsRetval真的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现堆栈溢出这个问题googleing的时候,但它已被删除。于是,我再次列出了这个问题。

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

正如我无法找到 LcidAttribute RetvalAttribute 在BCL,我想C#还没有提供区域设置标识符参数和返回值参数的支持。

As I can't find the LcidAttribute or RetvalAttribute in BCL, I guess C# hasn't provided the support for locale identifier parameter and return value parameter.

是不是这样?

谢谢大家。

推荐答案

它们与的 ParameterAttributes枚举。这是元数据用于方法的参数,只有编译器可以发出[MODOPT]。

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].

我不知道一个编译器,实际上做到这一点的。我有一个体面的猜测,虽然,这些属性在IDL中也使用了背景。这是一种在COM和RPC使用的接口描述语言。有了这个选择确保了.NET元数据还可以描述的那种写在IDL,可以在类型库中出现的声明。

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.

[LCID]属性是<一个HREF =htt​​p://msdn.microsoft.com/en-us/library/windows/desktop/aa367067%28v=vs.85%29.aspx相对=nofollow>此处描述。它实际上并没有描述使用,我从来没有用它自己。没有真正知道为什么你会使用它。

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.

[RETVAL]属性的此处描述。在COM自动化方法的声明非常重要,它标志着返回方法值的参数。并通过像Tlbimp.exe将一个工具使用,改写,使该参数的返回值类型的方法。

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.

这篇关于如果是ParameterInfo.IsLcid或ParameterInfo.IsRetval真的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆