开发者

How do you add < or > to a summary tag in Visual studio?

开发者 https://www.devze.com 2022-12-25 12:17 出处:网络
How do you add < (less than) or > (开发者_StackOverflowgreater than) to a summary comment in visual studio? I am in Visual Studio 2008.

How do you add < (less than) or > (开发者_StackOverflowgreater than) to a summary comment in visual studio? I am in Visual Studio 2008.

I have a generic method:

public bool IsMemberProtected<T>(Expression<Func<T, object>> expression)

Would love to have a summary tag of something like this

    /// <summary>
    /// Determines whether a member is protected.
    /// 
    /// Usage: IsMemberProtected<ExampleType>(x => x.Member)
    /// </summary>

But when I do that, the tooltip for the property no longer works when a developer hovers over the method in code to view the summary tag.

Thoughts?


You can use the entities &lt; and &gt; to give < and > respectively.

Notice that here you also use < and > to write a generic type. In this case there is a convention that if you use a cref tag then you can use GenericType{T} instead of the uglier GenericType&lt;T&gt;. See here for more information.

Also from that page there is another suggestion if you have to write a lot of < and > symbols that you put the text in a CDATA section:

/// <summary>
/// This a simple collection which implements <see cref="IEnumerable{T}" />
/// </summary>
/// <example>
/// <![CDATA[
/// SimpleList<int> intList = new SimpleList<int>();
/// ]]>
/// </example>


i think this may help you.

Right-click on the function, select "Document this" for Ex.

public void Function_Name()

becomes

/// <summary>
/// Give the details here
/// </summary>
/// <param name=""></param>
/// <returns> you can tel what it returns </returns>
public void Function_Name()

(it is all auto generated).

0

精彩评论

暂无评论...
验证码 换一张
取 消