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?
<scriptsrc="http://code.jquery.com/jquery-1.8.2.js"type="text/javascript"></script>
In Windows Forms, the ToolTip represents a tiny pop-up box which appears when you place your pointer or cursor on the control and the purpose of this control is it provides a brief description about the control present in the windows form.
Ctrl+Space opens the IntelliSense dropdown list, but pressing Ctrl+Shift+Space inside the brackets of the method call gets the tooltip.
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) { } }
Just above your class, method or property, type ///
then press return. This will generate the documentation template for you.
Forgot to answer the other part of your question: this is known as XML Documentation Comments and there is a substantial amount of information about this in MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With