Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I add parameter comments for a method in c#

Tags:

c#

.net

When I use any .NET methods, there is a little hint which explains the methods and their parameters.

How do I achieve the same behaviour for my own methods? Is there a Visual Studio feature which allows me to add these in?

like image 473
jaffa Avatar asked Nov 24 '11 12:11

jaffa


1 Answers

the "feature" is called XML comments. Just type /// right before your methods and VS will generate some xml tags. These will be used to show the tooltip as well as parameter info aso.

/// <summary> /// this will be the tooltip /// </summary> /// <param name="args">args will be passed when starting this program</param> static void Main(string[] args) {  } 

Screenshot of my VS2010 when calling method add. As you can see, xml comments are shown. Screenshot of my VS2010 when calling method ADD

like image 160
Pilgerstorfer Franz Avatar answered Oct 11 '22 22:10

Pilgerstorfer Franz