C# 注释写法

72 阅读1分钟

案例

以下面代码为例:


using System.Globalization;

namespace WebApplication2.Controllers
{
    public class BoolToVisibilityConverter
    {
        /// <summary>
        /// This is a converter function which converts bool into visibility
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetTpye"></param>
        /// <param name="paramter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public object Convert(object value,Type targetTpye,object paramter,CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

文本强调

<see langword="xxxx"/>

image.png

添加超链接

<see cref="xxxx"/>

image.png

添加类比

<seealso cref="xxxx"/>

image.png

添加注释段落

/// <remarks>
/// <para>
///  xxxxx
/// </para>
/// </remarks>

image.png

添加使用案例

/// <example>
/// This is example of how to use this converter in XAML
/// <code lang="xxxx">
/// <![CDATA[
/// xxxxx
/// ]]>
/// </code>
/// </example>

image.png