c# - 正确记录 C# 事件委托(delegate)

标签 c# xml-documentation

我希望我使用的是正确的术语。

我想记录一个公共(public)事件 Action<> delegate

public event Action<int, int, WriteableBitmap, Exception> OperationDone

为此,我希望用户知道哪个泛型代表什么。所以我在想类似的事情:

    /// <summary>
    /// Event triggers if a thumbnail image has been loaded. If loading a thumbnail was requested and the request has failed, 
    /// the causing exception will be passed as argument (otherwise null).
    /// pdfViewerPage, newViewerPage, bitmap, exception
    /// <param name="pdfViewerPage"/> viewer page of the thumbnail at the time of the request creation
    /// <param name="newViewerPage"/> viewer page of the thumbnail at the time of the request completion
    /// <param name="bitmap"/> Bitmap of the thumbnail
    /// <param name="exception"/> Exception of the request
    /// </summary>

但这给了我警告,因为委托(delegate)没有定义参数。有没有办法很好地记录这个,还是我必须坚持只使用 summary

最佳答案

尝试使用typeparam 相反:

/// <typeparam name="pdfViewerPage"> viewer page of the thumbnail at the time of the request creation</typeparam>
/// <typeparam name="newViewerPage"> viewer page of the thumbnail at the time of the request completion</typeparam>
/// <typeparam name="bitmap"> Bitmap of the thumbnail</typeparam>
/// <typeparam name="exception"> Exception of the request</typeparam>

关于c# - 正确记录 C# 事件委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40154396/

相关文章:

c# - C# XML 文档注释中的不同颜色

c# - 我如何遍历我的类属性并获取它们的类型?

c# - 如何使用 C# 将 2 字节 C 日期转换为 .NET DateTime?

c# - 随时间变化的数据聚合

c# - 如何使用复选框动态更改 WPF 控件的模板?

c# - 在 PowerPoint 中的文本框中查找动画的开始/结束字符索引

c# - VS2015CE 中 <para></para> 和 <para/> 显示的额外空行,无法消除

c# - 如何在 C# 中评论/记录覆盖?

c# - 在 xml 注释中,我可以标记方法名称以便它们可重构吗?

c# - C# : What are technical reasons to prefer///or/** 中的文档注释