c# - Visual Studio XML 注释

标签 c# visual-studio

这是一个示例,不必费心阅读它,只需注意事物可以变得有多大:

/// <summary>
/// An animated sprite is stored as one image, visually divided in
/// matrix-like form where each frame is one element. Frames are numbered
/// from 0 to some number n. The top left frame in the matrix is at (0, 0)
/// and the bottom right is at (n, n). Given a frame number this method
/// returns a position in that matrix.
/// </summary>
/// <param name="frame">Frame number.</param>
/// <returns>Matrix position.</returns>
/// <remarks></remarks>
/// <seealso cref="Book: C# Game Programming for Serious Game Creation."/>
public System.Drawing.Point GetMatrixPositionFromFrameNumber(int frame)
{
    System.Drawing.Point point = new System.Drawing.Point();
    point.Y = frame / framesX;
    point.X = frame - (point.Y * framesX);
    return point;            
}

你们会这样评论吗?或者你们是否以某种方式从源文件中获得评论?

谢谢

最佳答案

中国有句古话:“注释越接近代码越好”。

我对这个长度并不感到惊讶。

您稍后可以使用 sancaSTLe 等工具从源代码中提取此信息。

关于c# - Visual Studio XML 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7190386/

相关文章:

c# - 以编程方式通过 C# 代码格式化 Html 代码(如 Visual Studio 中的 Ctrl + E + D)

c# - 将 Microsoft SQL 数据库迁移/转换为 MongoDB 数据库的最佳方法?

c# - 如何打印支票?

c# - 如何在 UWP 中为 ComboBox 启用自由文本

c# - 运行在 visual studio 中作为资源添加的 exe 文件

visual-studio - 如何停止 Msunit 测试以停止控制台日志记录?

c++ - 使用SSE2缩放字节像素值(y = ax + b)( float )?

c++ - Regex根据编译器替换不同的输出

c# - 通过c#/Dapper读取MySQL数据库时utf8字符不正确

c# - 是什么触发了使用 SpaServices 在 HMR 中重建 webpack-bundle?