Customize C# Standard Document Generators (XML Comments) in Visual Studio

匆匆过客 提交于 2019-12-01 04:32:09

问题


  • Is there any other kind of documentation generator shortcuts for C# (like /// Generates function() Code) or any tool item (like signature in email @ outlook) in VS IDE, For following MS Standard Coding & Documentation & making understand to other co-developer working on same project.
  • How to change the Format of the Generated document in visual stdio IDE by default comment format to custom comment format shown below.

Ex:

 1. **Default Format**

     // Name:      
     // Author:     
     // Description: <summary></summary>    
     // Parameters: <param name="abc"></praram>  
     // Returned Value: <returns></returns>

 2. **New Custom Format**

     // Application:  <project></project>  <version></version> 
     // Created Developer: <developer></developer>
     // Created Date: <date></date>  
     // Last Modified:     
     // Last Modified Developer:     
     // Parameters: <param name="abc"></praram>      
     // Return Type: <returns></returns>    
     // Description: <summary></summary>

回答1:


Not sure if you mean instead of the /// comments but there are lots of options from this question here:

https://stackoverflow.com/questions/641364/c-sharp-documentation-generator

There is also these articles here:

http://msdn.microsoft.com/en-us/magazine/dd722812.aspx#id0400027

http://blogs.msdn.com/b/lisa/archive/2010/05/25/how-to-customize-the-xml-comments-that-are-inserted-by-the-visual-basic-code-editor.aspx




回答2:


One of the tools that let you customize the default XML comment is our VSdocman. You can pre-define the comment for each code element type (method, property, ...) and even for particular name or type. It's called comment templates. Then in the code editor, right-click and select "Add XML comment". In addition, you can generate a documentation (HTML, CHM, docx, VS help, ...) from your comments with the tool.




回答3:


This is now >6 months old, but I think the answer to this question: Change default XML comment snippet in Visual Studio will get you where you want to be. Just add your custom comment structure to the CDATA section, and you're all set.



来源:https://stackoverflow.com/questions/26750385/customize-c-sharp-standard-document-generators-xml-comments-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!