当前位置: 首页 > article >正文

[C#学习笔记]注释

官方文档:Documentation comments - C# language specification | Microsoft Learn

一、常用标记总结

1.1 将文本设置为代码风格的字体:<c>

1.2 源代码或程序输出:<code>

1.3 异常指示:<exception>

1.4 段落 <para>

1.5 换行<br>

1.6 方法参数<paramref> 

1.7 返回值<returns>

1.8 生成条目<see> 

1.9 生成子条目<seealso> 

1.10 描述泛型类或方法<typeparam> 

1.11 属性描述<value>

 

1.12 引用其他注释<inheritdoc>

1.13 额外注释<remarks>

1.14 高亮文本<langword>

二、格式参考

 代码:

/// <summary>
/// this is a converter function which converts <see langword="bool"/> into a <see cref="Visibility"/>
/// </summary>
/// <remarks>
/// <para>
/// This converter will receive a <see langword="bool"/> value and return a <see cref="Visibility"/> depending on the value.<br/>
/// If the value is <see langword="true"/>, the return value will be <see cref="Visibility.Visible"/>;<br/>
/// Otherwise, the return value will be <see cref="Visibility.Collapsed"/>
/// </para>
/// </remarks>
/// <example>
/// This is as example of how to use this converter in XAML
/// <code lang="xaml">
/// <![CDATA[
/// <Window>
///     <Window.Resources>
///       <local:BoolToVisibilityConverter x:Key="converter"/>
///     </Window.Resources>
///     <CheckBox Name="check"/>
///     <Image Visibility={Binding ElementName=check, Path=IsChecked, Converter={StaticResource converter}}" />
/// </Window>
/// ]]>
/// </code>
/// </example>
/// <param name="value"></param>
/// <param name="targetType"></param>
/// <param name="parameter"></param>
/// <param name="culture"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
    throw new NotImplementedException();
}

预览1 

预览2 


http://www.kler.cn/news/293635.html

相关文章:

  • 168套Android项目源码和120多套各类别小程序模板源码
  • KADAL | Kriging代理模型Python工具箱推荐
  • StarRocks Lakehouse 快速入门——Apache Iceberg
  • 应用层协议HTTP
  • Flask中实现WebSocket需要什么组件
  • 泛微E9 Ecology9-JS应用高级进阶视频教程(重磅)
  • linux autofs配置
  • [数据集][目标检测]鲜花检测数据集VOC+YOLO格式25215张106类别
  • Oracle中关于not in的替代方案
  • kafka及异步通知文章上下架
  • Jenkins构建CI/CD
  • VSC++: 括号对称比较
  • 使用Cskin时候 遇到按钮有默认阴影问题解决
  • Java语法全解析:掌握基本规则,打造稳固编程基础!
  • 企业级Ansible自动化运维项目案例:实战与技巧
  • 集成 Logrus 到 Gin:打造高效的 Go Web 日志系统
  • 【python因果推断库10】工具变量回归与使用 pymc 验证工具变量3
  • 音频基础学习四——声音的能量与分贝
  • 探索Mem0:下一代人工智能与机器学习内存管理基础设施(二)Mem0+Ollama 部署运行
  • .net中的内存管理和垃圾回收
  • CSS学习14[重点]--定位、边偏移、定位模式
  • linux-性能优化命令
  • Css:属性选择器、关系选择器及伪元素
  • 【项目二】C++高性能服务器开发——日志系统(日志器,日志级别,日志事件)
  • 2024高教杯数学建模B题思路
  • shell编程--正则表达式
  • SAP ABAP 程序迁移工具 SAPLINK ABAP GIT
  • Oracle 19c数据库:Windows详细安装与配置指南
  • 【操作系统】进程同步之共享内存
  • [dp]答疑