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) { } }