Both, XML comment in a comment rule and common comment in a comment template wouldn't be very useful without macros. Macro is evaluated during comment addition.

The syntax of comment macros is the same as macro language used in output templates. But you don't need to learn anything about macros. Basically, macro name is embedded between two "$" characters. You don't even need to remember comment macros because there is always Insert Macro button available which lists all comment macros.

Comment macros list

Macro

Meaning

$MEMBER-NAME$

The short name of commented member.

$MEMBER-FULLNAME$

The full name of commented member, including namespace and class.

$MEMBER-CREF$

The cref reference of commented member. It can be used as cref attribute of <see> tag.

$TYPE-NAME$

The short name of value or return type of commented member.

$TYPE-FULLNAME$

The full name of value or return type of commented member, including namespace and class.

$TYPE-CREF$

The cref reference of value or return type of commented member. It can be used as cref attribute of <see> tag.

$PARAMETERS$

The complete list of <param> tags for all parameters.

$TYPE-PARAMETERS$

The complete list of <typeparam> tags for all type parameters.

$DECLARING-TYPE-NAME$

The short name of declaring type of commented member.

$DECLARING-TYPE-FULLNAME$

The full name of declaring type of commented member, including namespace and class.

$DECLARING-TYPE-CREF$

The cref reference of declaring type of commented member. It can be used as cref attribute of <see> tag.

$DECLARING-TYPE-KIND$

The type of declaring type of commented member, e.g. "class", "interface", etc.

$INHERITED-COMMENT-MEMBER-CREF$

The cref reference of the member from which a comment can be inherited. It may be overridden or implemented method, property or event.

$DESCRIPTION-ATTRIBUTE$

The value of System.ComponentModel.Description attribute of commented member, if any.

$PROPERTY-GET-OR-SET$

The standard sentence start for properties depending on presence of get and set part. For example, "Gets or sets ...".

$DATE$

Current date in DateTime.ToShortDateString format.

$TIME$

Current time in DateTime.ToShortTimeString format.

$COMPUTER-NAME$

Current machine name.

$USER-NAME$

Current user name.

$%ENVIRONMENT-VARIABLE%$

Value of any environment variable, e.g. $%PATH%$ .

$CURSOR$

Specifies where the cursor will be positioned after inserting XML comment using "Add XML comment" function. You can have several $CURSOR$ macros in your comment. The cursor will be placed at the first occurrence of $CURSOR$ macro.

You can also use any macro command used in output templates. But in comment templates, only $IFNOTEMPTY$ command is useful.

See Also