How to add Intellisense descr  
Author Message
rperreta





PostPosted: Visual C# Language, How to add Intellisense descr Top

I'm trying to figure out how to add descriptions to my functions for intellisense. I don't want to create an xml file unless it's a must. Is there a simple way to add it to the class function line. I did it in vb in a course I took but I don't remmeber and i want the c# version. I found on another forum someone said use ///summary but that don't seem to work. Maybe I have it in the wrong place... Please advise... thanks

namespace ActiveDirectoryFunctions

{

/// <summary>

/// This is my class.

/// </summary>

public class Functions

{

public static Boolean AuthenticateUser(String username, String password, String LDAP)

{

/// <summary>

/// This is my class.

/// </summary>



Visual C#6  
 
 
Michael Koster





PostPosted: Visual C# Language, How to add Intellisense descr Top

The /// <summary> is the right approach. You simply have to apply this to your methods as well.

Here is a sample:
/// <summary>
/// This is my class.
/// </summary>
public class Functions
{
/// <summary>
/// The description
/// </summary>
/// <param name="username">Username</param>
/// <param name="password">Bar</param>
/// <param name="LDAP">Foo</param>
/// <returns>a meaningfull description</returns>
public static Boolean AuthenticateUser (String username, String password, String LDAP)
{
...

In addition, enable the XML documentation file in the project properties. In the 'Build' Tab, check 'XML documentation file' and specify a name of your choice.

Hope this helps
Michael



 
 
rperreta





PostPosted: Visual C# Language, How to add Intellisense descr Top

That doesn't seem to be working - I must be missing something... Do I have to check the xml option in build Or can I just add the description to each function. I did this in a vb .net class and I don't remember what the syntax was but I didn't need to create an xml file. Please advise...

-rich


 
 
Michael Koster





PostPosted: Visual C# Language, How to add Intellisense descr Top

The syntax in VB.NET 2005 is very similar to the C# one. instead of the /// (C#) you write ''' (VB.NET)

Here is a sample:
''' <summary>
''' This is my class
'''
</summary>
''' <remarks></remarks>
Public Class Class1
''' <summary>
''' my Sub
''' </summary>
''' <param name="foo">the parameter </param>
''' <remarks></remarks>
Public Sub MySub(ByVal foo As Integer)

End Sub

End Class

In the project properties (right click on project -> properties) - select the compile tab. Tick the checkbox 'Generate XML documentation file'.
You should now find the documentation XML file in the bin output folder.

Michael