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

查看:237
本文介绍了如何引用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 E 都是有效的并且可能是编译器警告消失的原因。

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

然而,您应该使用引用字段的 F 。有关Visual 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天全站免登陆