如何使用外部文档将摘要添加到类文件 [英] How to add summaries to a class file using external document

查看:79
本文介绍了如何使用外部文档将摘要添加到类文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用外部文件执行此操作:



Is it possible to do this using external file:

/// <summary>
        /// Set the box header 
        /// </summary>
        [DataMember]
        public bool HasHeader { get; set; }





我尝试过:



我需要使用外部文件执行上述操作。



What I have tried:

I need to do the above using external file.

推荐答案

向代码添加XML注释的唯一真正方法是手动执行。 Visual Studio有一个名为GhostDoc的辅助扩展。它有助于缓解疼痛。



当然,您可以编写一个应用程序来为您完成,但手动评论代码需要花费更少的时间比开发,测试和调试应用程序更好。



当然,如果你刚刚评论过,而不是把它关掉,那么这一切都没有实际意义。



最后,您的客户想要这样做,因为当他们雇用其他人来维护您的代码时,他们希望代码能够被合理地记录下来。
The only real way to add XML comments to your code is to do it manually. There is a helper extension available for Visual Studio, called GhostDoc. It helps ease the pain a little.

Of course, you could write an application to do it for you, but it would take a lot less time manually commenting the code than it would to develop, test, and debug an application.

Of course, this would all be moot if you had just commented as you went instead of putting it off.

Finally, your client wants this because when they hire someone else to maintain your code, they want the code to be reasonably well documented.


重申John所说的,最好的方法是在编写应用程序代码时在代码中编写XML注释。接下来,您可以使用文档生成器(如 Sandcastle )来构建多种不同类型的文档。



此外,在VS项目选项下:Build-> Output->(check)XML文档文件

当您从注释构建代码时,这将编写XML文档文件。然后,其他工具(如Sandcastle)可以使用XML为您的客户端构建丰富的文档。
To reiterate what John has stated, the best way is to write your XML comments in code while you write your application code. Next, you can use a documentation generator, like Sandcastle to build multiple different kinds of documentation.

Also, under VS project options: Build->Output->(check) XML Documentation file
This will write an XML documentation file when you Build your code from your comments. The XML can then be used by other tools, such as Sandcastle, to build rich documentation for you client.


这篇关于如何使用外部文档将摘要添加到类文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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