【发布时间】:2019-04-03 15:02:23
【问题描述】:
我正在尝试在 Visual Studio 工具提示中添加有关如何使用我的函数的信息,类似于默认情况下每个 async function 的完成方式。
例子:
/// <summary>
/// Executes an asynchron operation
/// </summary>
/// <usage> <-- I am looking for something like this
/// try
/// {
/// bool x = await DoSomething();
/// }
/// finally
/// {
/// await CleanUp();
/// }
/// </usage>
public async Task<bool> DoSomething()
{
return await SomeAsynchronOperation();
}
我尝试使用 <example> 标记,但此文本未显示在工具提示中。
official documentation 中没有任何其他标签的描述允许这样的事情。
async 函数是如何完成的,是否有可能对其他函数做同样的事情?
【问题讨论】:
标签: c# visual-studio