【问题标题】:How to refer to array types in documentation comments如何在文档注释中引用数组类型
【发布时间】:2011-01-22 23:23:42
【问题描述】:

I just posted this question 并了解了<see cref="">,但是当我尝试时

/// This is a set of extensions that allow more operations on a <see cref="byte[]"/>.

编译器警告我它的格式不正确。我需要做什么才能正确看到代码引用?

【问题讨论】:

  • 我不认为这是对 [] 本身的反对,更多的是关于编译器无法将 byte[] 识别为可链接类型。我已更改您问题的标题以反映这一点:如果您不同意或认为我错了,请回滚。

标签: c# .net visual-studio-2008 documentation comments


【解决方案1】:

this post 中所述,使用

 <see cref="T:byte[]" />

【讨论】:

  • 我试图用T:string[] 来做这件事,但它不起作用。 Array.string 似乎有效。
【解决方案2】:

你可以这样写:

/// <summary>
/// Array byte <see cref="byte"/>[]
/// Nullable byte <see cref="byte"/>?
/// </summary>

/// <summary>
/// Array byte <see cref="T:byte[]"/>
/// Nullable byte <see cref="T:byte?"/>
/// </summary>

【讨论】:

    【解决方案3】:

    你可能应该有&lt;summary&gt;...&lt;/summary&gt;

    /// <summary>
    /// This is a set of extensions that allow more operations on a <see cref="byte[]"/>.
    /// </summary>
    

    【讨论】:

    • 我做了,但我从示例中删除了它,因为我不想输入 3 行。
    猜你喜欢
    • 2021-04-08
    • 1970-01-01
    • 1970-01-01
    • 2018-08-01
    • 2012-01-09
    • 2023-03-12
    • 2016-09-22
    • 1970-01-01
    • 2021-08-27
    相关资源
    最近更新 更多