简体   繁体   中英

How to view the content of the <returns> tag?

In Microsoft Visual C# 2010 Express, whenever I create a function, and use the 3 slashes to create the help code, I get something like this:

/// <summary>
/// Function to sum 2 numbers.
/// </summary>
/// <param name="foo">First number.</param>
/// <param name="bar">Second number.</param>
/// <returns>The sum of the numbers.</returns>
public int foobar( int foo, int bar )
{
    return foo + bar;
}

I know that whenever I want to know what a function does, I can hover my mouse over it, and the tooltip shows the text written between the <summary> tags.

Also, whenever I open the parentheses to write the parameters of the function I'm calling, I see the tooltip below the cursor which displays the text written between the <param name="foo"> tags.

So, my question is: Can I view the text written between the <returns> tags without having to go to definition and view it in the code it's written in? And if so, how?

You can view it in View >> Object Browser .

Apart from this you do not see it anywhere else. In case you would like to present the "return" information via a tooltip then it is better to put it inside the <summary> itself as a part of the description. There are some possibilities to make the <summary> more readeable when you want to put more text inside, eg by using <para> :

///<summary>
///<para>line1</para>
///<para>line2 (e.g. what a method returns)</para>
///</summary>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM