2010-04-05 82 views
5

你如何添加<(小於)或>(大於)在Visual Studio的總結評論?我在Visual Studio 2008中你如何添加< or >在Visual Studio摘要標籤?

我有一個通用的方法:

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

很想有東西彙總標籤這樣

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

但是當我做當開發人員將代碼中的方法懸停在代碼中查看摘要標籤時,該屬性的工具提示不再有效。

想法?

回答

10

您可以使用實體&lt;&gt;分別給出<>

請注意,在這裏,你還可以使用<>寫一個通用的類型。在這種情況下,有一個約定,如果你使用一個cref標籤,那麼你可以使用GenericType{T}而不是醜陋GenericType&lt;T&gt;。有關更多信息,請參閱here

也是從那個頁面還有另外一個建議,如果你有寫很多的,你把文本在CDATA部分<>符號:

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

我認爲這可以幫助你。在功能上

單擊鼠標右鍵,選擇「文檔此」 防爆。

public void Function_Name() 

變得

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

(它是產生的所有自動)。