Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create ///summary

How do I generate these kind of summaries in Visual Studio?

/// <summary> ///  Returns a number /// </summary> /// <param name="num"></param> /// <returns></returns> 
like image 710
user710502 Avatar asked Jun 29 '11 15:06

user710502


People also ask

How do you start a summary?

A summary begins with an introductory sentence that states the text's title, author and main point of the text as you see it. A summary is written in your own words. A summary contains only the ideas of the original text. Do not insert any of your own opinions, interpretations, deductions or comments into a summary.

What is an example of a summary?

A brief statement or account covering the substance or main points; digest; abridgment; compendium. Summary is defined as a quick or short review of what happened. An example of summary is the explanation of "Goldilocks and the Three Bears" told in under two minutes.


2 Answers

Type in /// before your method, property, etc. VS will generate the comment blocks automatically.

like image 102
George Johnston Avatar answered Sep 22 '22 23:09

George Johnston


As others have said, Visual Studio will, by default, add the documentation template automatically when you type three slashes in a row above the member declaration. If the member has any Attributes applied to it, then type the slashes on the line above the attributes.

Note, however, that one of the most useful things to document for a method (or constructer, property, etc.) is the exceptions that the method may generate. Those can be added by typing ///<exception after the rest of the documentation. When you accept the Intellisense suggestion, you will be provided with a place for the Exception type as an XML attribute, and you can fill in the circumstances in the exception element content.

If any parameters are added to a method after the documentation is already produced, then the Intellisense will also be very helpful in filling in the new paramter name when you go to add it to the documentation. It is a pretty slick feature.

like image 21
Jeffrey L Whitledge Avatar answered Sep 20 '22 23:09

Jeffrey L Whitledge