コード中に<summary>などのXML要素にコメントを書いておくことで、HTML形式のリファレンスを作ることが出来ます。
namespace WindowsApplication1
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.ListBox lstTable;
private System.Windows.Forms.Button btnOpenFile;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
・・・
・・・
Visual Studio からは「ツール」→「Webページのビルド コメント」を選択します。結構きれいにできるので、お気に入りです。
よく使用されるXMLタグを以下に示します。
| タグ |
用途 |
| <summary> |
概要 |
| <param> |
引数の説明 |
| <remarks> |
メソッドの説明 |
| <value> |
プロパティの説明 |
| <returns> |
戻り値の説明 |
| <exception> |
発生する例外の説明 |
また、Visual Basic .NET の場合は次のようにコメントを記述します。
Namespace WindowsApplication1
{
Public Class Form1
Inherits System.Windows.Forms.Form
{
Friend WithEvents dataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents lstTable As System.Windows.Forms.ListBox
Friend WithEvents btnOpenFile As System.Windows.Forms.Button
Friend WithEvents openFileDialog1 As System.Windows.Forms.OpenFileDialog
・・・
・・・