Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to generate comment lines documentation of c# code ?
i have the comments in code like following

///
// Function Name : abc
// Description : xyz
///
Posted

That's a pity, because the easiest way to do it is to use the built in XML comments system...http://msdn.microsoft.com/en-us/magazine/cc302121.aspx[^] - it's an old article, but it gives you the idea.

If you use XML comments (and it's very simple - just start a blank line with "///" above a field, property of method definition and it will do the rest) then you can build documentation from this very easily. And as an extra incentive, the XML comments are transferred into Intelisense as well.

One of the first things I do when I create a new project is to turn on XML enforcement: On the Build tab of the Project Properties, tick the XML Documentation file checkbox. You will then get warnings with each compilation where you haven't documented a method properly. If you also check the "All" radio button under "Treat warnings as errors" on the same tab (as I do) then you can't even run your program unless you have documented it correctly.
 
Share this answer
 
Comments
ATM80 6-Jul-12 0:02am    
thanks
That looks to be a custom type of commenting. There are different third-party addins that can do something similar. It may also be that this is a hand-developed commenting system.

If you are looking for the built-in documentation comments in C#, they would look like this:

C#
/// <summary>
/// 
/// </summary>


You get this by typing the backslash character three times on the line above a method or class (there are a couple other places you can do this as well). The system will auto-generate this list. If you are doing this above a method, it will add parameter lines for each parameter that the method takes as well as a return line for what the method returns (if it doesn't return void).

The benefit of using the XML comments is that they can be picked up by Visual Studio and used by the rest of the system and by automated documentation systems.
 
Share this answer
 
Comments
ATM80 5-Jul-12 23:55pm    
thanks Tim.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900