简体   繁体   English

如何参考XML文档C#中的class属性?

[英]How to refer to class properties in XML docs C#?

Suppose I have a method in a class假设我在 class 中有一个方法

public class MyClass{
   public int MyInt;

   /// <summary>
   /// Prints out the value of <paramref name="MyInt">
   /// </summary>
   public void PrintValueOfMyInt()
   {
     ...
   }
}

Is this the correct way to refer to the MyInt member in the XML doc above PrintValueOfMyInt ?这是在 PrintValueOfMyInt 上方的PrintValueOfMyInt文档中引用MyInt成员的正确方法吗? If not, how to do it?如果没有,怎么办?

A solution is to use <see cref="MyInt"/> , so in total we get:一个解决方案是使用<see cref="MyInt"/> ,所以我们总共得到:

/// <summary>
/// Prints out the value of <see cref="MyInt"/>
/// </summary>
public void PrintValueOfMyInt()
{
  ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM