我目前是一名编程学生,显然我的问题很简单,但我无法在网上找到答案.所以这里是:
在XML /// C#中的注释中,<returns>标签出现在哪里,我知道<summary>当你将鼠标悬停在方法调用上而不是返回标记时,标记中包含的所有内容都会显示在intellisense中.
那么<returns>标签在哪里?
谢谢.
A9S*_*9S6 34
在View >> Object Browser中看到方法时
例如,你会看到这样的事情:
private int GetColumnIndex(Microsoft.Office.Interop.Excel.Worksheet worksheet, string columnName, int rowIndex, int startColumnIndex)
Member of MyAddIn.CommandHandlers.CommandHandler
Summary:
Returns the column index with specified name and in specified row
Parameters:
worksheet: Target worksheet
columnName: Column name to find
rowIndex: Row index in which to search the column
startColumnIndex: Start index of the column
Returns:
The index of column if found, else returns 0
Run Code Online (Sandbox Code Playgroud)
当您选择在编译时构建XML文档文件时,XML文档注释中包含的所有内容都会被复制到该文件中.像Sandcastle这样的程序可以构建类似于MSDN的HTML文档.
据我所知,它不会在Visual Studio自己的IntelliSense中显示.但那不是在那里写东西的借口:-).例如, ReSharper的Ctrl + Q 确实显示了它.
小智 5
对于那些可能试图寻找某些东西的人。这可能不是最好的方法,但恕我直言,它确实使将鼠标悬停在方法名称上时更容易理解方法的作用。
/// <summary>
/// Adds a new post given the mapped PostDTO and userId <br></br><br></br>
/// <b>Returns</b> the newly created object, otherwise null.
/// </summary>
/// <param name="postDTO"></param>
/// <param name="userId"></param>
PostDTO addPost(PostDTO postDTO, long userId);
Run Code Online (Sandbox Code Playgroud)
这样你就可以在 VS 中看到一些东西(至少在 VS 2019 中),如下图所示,根据我的经验,当试图理解其他人编写的代码时,至少你可以知道会发生什么,无论是实际的还是object,null或者其他什么设想。
我希望它对其他人有用。
| 归档时间: |
|
| 查看次数: |
13147 次 |
| 最近记录: |