description in the code

J

Jeff

hey

..NET 2.0

I'm wondering if it is possible to add some description to the code. Text
which describe for example what a property of a class does etc - I don't
mean comments

Lets say I have this code <lets say it is from a class named Car>;
private string _plate;
public string Plate
{
get { return _plate; }
set { _plate = value; }
}

Now if some other programmers try to access this Plate property, then I
would like to add a description which appear as tooltip when the user types
Car. and in the typeahead showing the available methods and properties
available, so when the programmer scroll down to "Plate" in the list a
tooltip could for example display "Returns a cars vehicle registration
plate"

The clue is that I think this would make the code easier to understand for
other developers, they don't have to open the Car class to see what's going
on....

any ideas if this is possible?
 
J

Jon Skeet [C# MVP]

.NET 2.0

I'm wondering if it is possible to add some description to the code. Text
which describe for example what a property of a class does etc - I don't
mean comments

In fact, you *do* mean comments - XML documentation comments.

Type /// just above the property declaration, and VS will create a
template of:

/// <summary>
///
/// </summary>

You can then type between the summary open/closing tags. There are
other tags available - see "XML documentation comments" in MSDN for
more details. Note that if you're going to use the project from other
solutions, you'll need to build the XML file with the same name as the
DLL; look in the property pages for the project for the option to
enable this.

Jon
 

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

Top