Document and comment c# codes with Visual Studio and XML
[10 mn de lecture - paru le 5/11/2004 1:50:40 PM - Public : Débutant]
|
   
|
Auteur
2. Tags
2.1. Visual Studio
Under VS.net, you can add comments while pressing three time "/".


After this combinaison, parameters and summary tags are automatically added, others tags must be add by hand in the code.
2.2. List of tags
Tag |
Description |
<event> |
Use this tag to declare events that are raised by a member
Syntax:
///<event cref="EventName">
///
///</event>
|
<example> |
Example of members use |
<exception> |
Declare exceptions that a class can throw |
<include> |
include another file |
<overloads> |
Specify overloads
Example:
///<overloads>Cette méthode a 2 surcharges</overloads>
///<summary>1ere surcharge</summary>
public void open() { ... }
///<summary>2eme surcharge</summary>
public void open(string str) { ... }
|
<param> |
to describe the parameters for the method.
/// <param name="sender"></param>
/// <param name="e"></param> |
<permission> |
permissions of a method |
<remarks> |
show a remark block |
<returns> |
to describe the return value. |
| <seealso> |
add a link to another doc
syntax:
<seealso href="url">[label]</seealso>
-
<seealso cref="member">[label]</seealso>
|
<summary> |
describe a member for a type |
<value> |
property of a param. |
Block Tags
This tags are used in <param> and <remarks> sections.
Tag |
Description |
<code> |
To indicate multiple lines as code |
<list> |
Add a list or a table |
<para> |
Delimits a text paragraph |
Inline Tags
This tags are used in <para> blocks.
Tag |
Description |
<c> |
to show code on 1 line (sur une ligne) |
<paramref> |
A reference to a parameter. |
<see> |
Reference to another member or type.
syntaxe :
<see href="url">[label]</see>
<see cref="member">[label]</see>
|
|