如何引用枚举在C#中的XML文档的常数 [英] How to refer to enum constants in c# xml docs

查看:201
本文介绍了如何引用枚举在C#中的XML文档的常数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要记录一个枚举类型字段的默认值:

I want to document the default value of an enum typed field:

/// <summary>
/// The default value is <see cref="Orientation.Horizontal" />.
/// </summary>
public Orientation BoxOrientation;



编译器警告说,它无法解析引用。前缀F:或M:沉默的编译器,但是E:也做,所以我不能确定什么前缀是正确的。

The compiler warns that it couldn't resolve the reference. Prefixing F: or M: silences the compiler, but E: also does, so I'm unsure what prefix is correct.

推荐答案

前缀˚F M 电子都是有效的大概编译器警告消失。其原因

The prefixes F, M and E are all valid and probably the reason that the compiler warning disappears.

不过,你应该使用˚F,指的领域。有关文件标识符Studio的视觉生成详细信息请参阅:

You should however use the F that refers to fields. For more information on how Visual Studio generates documentation identifiers see:

处理XML文件(C#编程指南)

这篇关于如何引用枚举在C#中的XML文档的常数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆