您可以为此使用XML 文档注释。
例如,对于您的ToString()
一些东西:
public class MyClass : IFormattable
{
/// <summary>Converts this to a formatted string.</summary>
/// <param name="format">
/// A format string. This may have the following values:
/// <list type="table">
/// <listheader>
/// <term>Format strings</term>
/// </listheader>
/// <item>
/// <term>"a"</term>
/// <description>Format using "a"</description>
/// </item>
/// <item>
/// <term>"b"</term>
/// <description>Format using "b"</description>
/// </item>
/// </list>
/// </param>
/// <param name="formatProvider">A format provider.</param>
/// <returns>The formatted string.</returns>
public string ToString(string format, IFormatProvider formatProvider)
{
switch (format)
{
case "a":
return "A";
case "b":
return "B";
default:
return "A";
}
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句