如何提取给定 IMethodMessage 的函数属性?
我有一个正在调用的函数的 IMethodMessage 实例。我想找出该函数的函数属性列表。有什么办法可以做到这一点吗?我看到我可以从 IMethodMessage 实例中提取方法名称和类型名称,但我不太清楚如何获取函数属性。
例如,如果我有以下函数:
[Steve()]
public void enterUsername(String username)
{
...
}
如何确定被调用的函数是否具有“Steve()”属性?
I've got an IMethodMessage instance for a function that's being called. I want to find out the list of function attributes for the function. Is there any way to do this? I see that I can extract method name and typename from the IMethodMessage instance, but I can't quite figure out how to get the function attributes.
For example, if I have the following function:
[Steve()]
public void enterUsername(String username)
{
...
}
How can I find out if the function being called has the "Steve()" attribute?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
IMethodMessage。 MethodBase
属性,然后调用GetCustomAttributes
获取方法的属性。You can use the
IMethodMessage.MethodBase
property, then callGetCustomAttributes
to get the attributes for the method.