【发布时间】:2017-08-02 21:52:01
【问题描述】:
我有这个示例方法:
/// <summary>
/// Method to enforce that the type is an Enum.
/// </summary>
/// <typeparam name="T"> Type.</typeparam>
/// <exception cref="ArgumentException"> Thrown when type is not an Enum type. </exception>
public static void TypeIsEnum<T>(T type)
{
if (!typeof(T).IsEnum)
{
throw new ArgumentException();
}
}
当我在 Visual Studio 中将鼠标悬停在此方法上时,intellisense 会显示一些额外信息,如下所示。
尽管我记录了 TypeIsEnum 方法可以抛出的 exception 的类型,并明确说明了它可以抛出的原因,但它并没有在 Intellisense 中显示原因。我如何显示为什么可以在 Intellisense 中抛出 exception 的原因?
【问题讨论】:
标签: c# .net visual-studio exception intellisense