一种链接到类,方法,特别是C#注释中的特定代码行的方法 [英] A way to link to a class,a method, especially a specific code line in C# comment
问题描述
我想使用代码中指向目标的链接来构建一些文档。目标可以是 Class
或方法
或特定代码行。 (指向特定代码行是最重要的)
我想到了VS2010的扩展名或特定注释标记。
有没有办法建立这种链接?
I want to build sort of documentation using links in code that point to a target. The target could be a Class
or a Method
or a specific code line. (pointing to a specific code line is the most important)
I thought of an extension for VS2010 or a specific comment tag.
Is there any way to make links of this kind ?
推荐答案
Xml评论+沙堡可能是你需要什么。您可以使用
Xml comment + sandcastle may be what you need. You can reference specified class or method using
<see cref=".."/>
和参考参数使用
<paramref name=".."/>
但是,没有直接的方法来引用某些代码行,但你可以引用某些#region by使用
However, there is not direct method to reference certain lines of code but you can reference certain #region by using
<code source="$sourcefile$" region="$regionname$"/>
请参阅: XML注释指南第20页。
请注意,您引用的代码将直接显示在原位而不是链接。它并不完美,但我希望它有所帮助。
Note that the code you reference will be displayed directly in place rather than a link. It is not perfect, but I hope it helps.
这篇关于一种链接到类,方法,特别是C#注释中的特定代码行的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!