How to add documentation tooltip to classes, methods, properties, etc. in C#?

Not sure if I'm even calling this right but I wanted to start adding some documentation to my classes, methods, properties, etc. I know this is probably super obvious but I never really learned it. I'm not sure where to start.

Just to clarify whenever you roll over a class (or method, property, etc.) it shows a tooltip in Visual Studio with some documentation on that specific method.

class Microsoft.Phone.BackgroundAudio.BackgroundAudioPlayer Provides background access to audio playback functionality such as play, pause, fast-forward, and rewind.

What is that called and how can I implement this in my C# application?

Answers


You can use /// or GhostDoc

Edit:

In first case you'll get

/// <summary>
/// 
/// </summary>
class A
{
    /// <summary>
    /// 
    /// </summary>
    public A() { }

    /// <summary>
    /// 
    /// </summary>
    public int Property { get; set; }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="obj"></param>
    public void Method(object obj) { }
}

In second

/// <summary>
/// 
/// </summary>
class B
{

    /// <summary>
    /// Initializes a new instance of the <see cref="B"/> class.
    /// </summary>
    public B() { }

    /// <summary>
    /// Gets or sets the property.
    /// </summary>
    /// <value>
    /// The property.
    /// </value>
    public int Property { get; set; }

    /// <summary>
    /// Methods the specified obj.
    /// </summary>
    /// <param name="obj">The obj.</param>
    public void Method(object obj) { }
}

Need Your Help

HQL “Contains” statement howto?

nhibernate hql contains icriteria

I have an entity that has a string property called Tags. I would like to query this entity based upon if a certain string is located in Tags property.

Custom component creation - how to add small icon representing component in Tool Palette?

delphi icons delphi-2009 custom-component

Please bear in mind that I've read all the instructions I could find about adding component icon to my custom component. And I am able to do this when we talk about the icon size which is 24x24 pix...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.