Attribute for Methods and Parameters

  • Thread starter Thread starter Kees de Winter
  • Start date Start date
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
 
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.
 
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
 
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
 
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
 
Back
Top