是否可以在运行时获取类摘要? [英] Is it possible to obtain class summary at runtime?

查看:121
本文介绍了是否可以在运行时获取类摘要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在C#的运行时获取类摘要?
我想通过反射获得类摘要,然后将其写入控制台。
按类概括我的意思是类定义前的总结注释,类似这样:

Is it possible to obtain class summary at runtime in C#? I would like to obtain class summary through reflection and then write it to console. By class summary I mean summary comments before class definition, something like this:

/// <summary>
/// some description
/// </summary>
class SomeClass
{
}

我不知道如果这些注释在编译代码后可用,但是如果他们也许有一种方法可以在代码中获取它们。

I don't know if these comments are available after compiling the code, but if they are maybe there is a way to obtain them in code.

感谢您提供帮助。

推荐答案

我曾经一次搞乱这个问题,并使用了这个家伙的解决方案。工作效果不错:

I once messed with this a while back, and used this guys solution. Worked pretty good:

http:// jimblackler.net/blog/?p=49

这篇关于是否可以在运行时获取类摘要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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