<code> 标记指示将其内部的文本表示为代码样式,Block 标记,用于表示多行的代码块。
<code [lang="language"][escaped="true"]>content</code>
其中:
可用于其他 Section 标记或 Block 标记内部。
使用 lang 属性表示语言选择器,标准的语言有: Visual Basic, C#, C++ 及 JScript。若代码块适用于多种语言,则用逗号隔开,比如“Visual Basic, C#, C++”。
escaped 为 true 时,其内部所有其他标记都被转义为代码块的一部分。
注意 content 内容必须是格式完好的 XML 注释。否则整个注释块可能被忽略或出错!!!
下面示例中,因为 escaped="true",因此直接写入了要作为代码块的 XML 内容。 Note how, in the following comments, the xml text can entered verbatim because the escaped="true" attribute has been applied.
[C#] /// <summary> /// Loads the XML. /// </summary> /// <example> The XML should have the following format. /// <code escaped="true"> /// <root> /// <