借助 <value> 标记,可以描述属性和属性访问器方法。 在 Visual Studio 集成开发环境中使用代码向导添加属性时,将为新属性添加 <summary> 标记。 需要手动添加 <value> 标记,以描述属性表示的值。
语法
/// <value>property-description</value>
参数
property-description
属性的说明。
备注
使用 /doc 进行编译以将文档注释处理到文件中。
示例
// xml_value_tag.cpp
// compile with: /LD /clr /doc
// post-build command: xdcmake xml_value_tag.dll
using namespace System;
/// Text for class Employee.
public ref class Employee {
private:
String ^ name;
/// <value>Name accesses the value of the name data member</value>
public:
property String ^ Name {
String ^ get() {
return name;
}
void set(String ^ i) {
name = i;
}
}
};