Attribute for Methods and Parameters

K

Kees de Winter

How do you get the description appearing in Intellisense for methods and
parameters of methods? Does anyone have an example ?

Much appreciated
Kees
 
G

Guest

Kees,

if you are using C#, just type /// on a line preceding the method
declaration (or ''' in VB 2005) - and VS will create a stub for you to fill
in with your description of the method and parameters if any.
 
H

Hans Kesting

How do you get the description appearing in Intellisense for methods
and parameters of methods? Does anyone have an example ?

Much appreciated
Kees

step 1: add the description to the source. In C# you can type /// above
the method (or property, or class) to get a starter definition.
step 2: in the properties of the project, set an XML documentation file
in VS2005: "Build" tab, checkbox "XML Documentation File". When you
check that, the filename automatically appears (projectname with
.xml extension)
step 3: REbuild the project (just a "build" is not enough)

Hans Kesting
 
R

Roland Dick

Hi Kees,
How do you get the description appearing in Intellisense for methods and
parameters of methods? Does anyone have an example ?

Intellisense gets these descriptions from the XML-style comment which
Visual Studio creates automatically when you enter three slashes /// in
the line above the method declaration:

/// <summary>
/// This is the summary for myFunction.
/// </summary>
/// <param name="i">The description for the parameter i</param>
/// <returns>Describes the return value</returns>
public int myFunction(int i)
{
}

You can find additional tags on
http://msdn2.microsoft.com/en-us/library/5ast78ax(VS.80).aspx

Hope this helps,

Roland
 
K

Kees de Winter

Perfect, thanks to all !


Roland Dick said:
Hi Kees,


Intellisense gets these descriptions from the XML-style comment which
Visual Studio creates automatically when you enter three slashes /// in
the line above the method declaration:

/// <summary>
/// This is the summary for myFunction.
/// </summary>
/// <param name="i">The description for the parameter i</param>
/// <returns>Describes the return value</returns>
public int myFunction(int i)
{
}

You can find additional tags on
http://msdn2.microsoft.com/en-us/library/5ast78ax(VS.80).aspx

Hope this helps,

Roland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top