0
我有一個類(C#編寫)的一些文檔註釋:的Visual Studio:要重命名的類/字段/方法的時候得到更新的文檔註釋
/// <summary>
/// Abstract class defining a tolerance-based method for Equals.
/// Tolerance must be defined in a derived class like this:
/// <code>class MyPrec : Precision { private MyPrec() : base(42) {} }</code>
/// (This subclass will have a tolerance of 42.)
/// </summary>
public abstract class Precision
{
protected readonly double TOL;
protected Precision(double tol)
{
TOL = tol;
}
/// <summary>
/// Checks if two doubles are equal up to numerical tolerance given by TOL.
/// </summary>
/// <param name="left">First double.</param>
/// <param name="right">Second double.</param>
/// <returns>True if the absolute value of the difference is at most TOL,
/// false otherwise.</returns>
public bool Equals(double left, double right)
{
return Math.Abs(left - right) <= TOL;
}
/// <summary>
/// Not Equals.
/// </summary>
public bool NotEquals(double left, double right)
{
return !Equals(left, right);
}
}
如果我在Equals
方法通過重命名參數left
Visual Studio的重命名功能,它也自動在文檔評論中重新命名。但它似乎只適用於即時參數。
如何編寫文檔註釋,以便在重命名相應的類/字段/方法時,以下單詞也由Visual Studio更新?
在類
Precision
/// <code>class MyPrec : Precision { private MyPrec() : base(42) {} }</code>
TOL
在方法Equals
/// <returns>True if the absolute value of the difference is at most TOL,
Equals
在總結註釋返回註釋的總結註釋的代碼示例Precision
NotEquals
/// Not Equals.
我使用Visual Studio 2015年
我已經嘗試過
/// <returns>True if the absolute value of the difference is at most <paramref name="TOL"/>,
,但它不工作。畢竟這不是輸入參數。
請發表您的相關問題,作爲一個單獨的問題。 –