Gib*_*Top 5 c# intellisense xml-comments visual-studio
我有一个方法,在命名空间下抛出异常:MyApp.Domain.我在命名空间下有一些自定义异常:MyApp.Domain.Exceptions.所以我拥有的是:
using MyApp.Domain.Exceptions
using System;
namespace MyApp.Domain
{
public class SomeClass
{
///<summary>This method does some stuff</summary>
///<exception cref="MyCustomExeption">MyCustomException if x</exception>
///<exception cref="Exception">GenericException if y</exception>
public void DoStuff(){
//Does stuff
}
}
}
Run Code Online (Sandbox Code Playgroud)
我用intellisense得到了我的总结,但没有例外.我是否必须使用include并创建外部xml注释文件,因为它们位于不同的命名空间下?这两个异常都没有出现在intellisense,mycustomexception或system.exception中.
谢谢.
实际上,Exception
一旦您输入完整的方法名称然后将鼠标悬停在上面,标签就会可见。
如果您想在开始输入方法名称后立即显示异常,则必须在摘要标记中提供异常,并用<para>
/// <summary>
/// this is my method for date convert
/// <para>Exception:</para>
/// Exception - this will appear as soon as you started typing the method name and method over.
/// </summary>
/// <exception cref="Exception"></exception>
Run Code Online (Sandbox Code Playgroud)
希望它能明确你想要什么。
当用户开始输入方法名称时,即可显示您想要的任何内容。您必须仅在摘要标签内提供。
归档时间: |
|
查看次数: |
1817 次 |
最近记录: |