Fre*_*red 7 c# xml summary visual-studio
我正在用C#编写HTML解析器,并希望包含它在摘要XML块中处理的HTML示例.如何防止<和>字符搞乱Visual Studio 2008的自动文档?
例:
/// <summary>
/// Creates a FlowSegment based on an HTML code, i.e. <bold>
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
public FlowSegment(string code)
{
Run Code Online (Sandbox Code Playgroud)
不幸的是,该示例导致此构造函数的工具提示显示(部分):
XML comment includes invalid XML
Run Code Online (Sandbox Code Playgroud)
而不是摘要评论.
如何逃避<和>字符?
Fre*_*red 18
我找到的最佳解决方案是更改它以替换<with <和>>
如XML规范中所见.
这使得示例看起来如下:
/// <summary>
/// Creates a FlowSegment based on an HTML code, i.e. <bold>
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
public FlowSegment(string code)
{
Run Code Online (Sandbox Code Playgroud)
这使得所需的工具尖端显示正确.
| 归档时间: |
|
| 查看次数: |
2644 次 |
| 最近记录: |