logo
CSharp_Prog_Guide

Рекомендуемые теги для комментариев документации

Компилятор C# может обрабатывать комментарии документации в коде в XML-файл. Обработка XML-файла для создания документации является деталью, которая должна быть учтена при реализации в узле.

Теги обрабатываются в конструкциях кода, таких как типы и члены типов.

Примечание.

Комментарии документации не могут быть применены к пространству имен.

Компилятор обрабатывает любой тег, который является допустимым тегом XML.

How to: Use the XML Documentation Features

The following sample provides a basic overview of a type that has been documented.

Example

// compile with: /doc:DocFileName.xml

/// <summary>

/// Class level summary documentation goes here.</summary>

/// <remarks>

/// Longer comments can be associated with a type or member

/// through the remarks tag</remarks>

public class TestClass

{

/// <summary>

/// Store for the name property</summary>

private string _name = null;

/// <summary>

/// The class constructor. </summary>

public TestClass()

{

// TODO: Add Constructor Logic here

}

/// <summary>

/// Name property </summary>

/// <value>

/// A value tag is used to describe the property value</value>

public string Name

{

get

{

if (_name == null)

{

throw new System.Exception("Name is null");

}

return _name;

}

}