How to get intellisense for custom created classes

2020-08-11 10:41发布

When you type "this." , you usually get all the routines, events, and more... of the current class you are in. And when you simply stand over one of the routines in the long list without choosing one, you usually get a description next to it.

How can I do that ? Let assume I have a class called CAR with two routines: speed_up(), and brake(). How can I make the person using my class to see a description of the two functions when he types:

CAR mycar = new CAR();
mycar.

7条回答
We Are One
2楼-- · 2020-08-11 11:45

You should use the XML documentation format available in Visual studio for every type constructs (ie class, methods, properties...)

To access it, type /// on the line before your declaration.

For instance:

  ///
  public void Method(string p){...

you will get something like:

  /// <summary>
  /// 
  /// </summary>
  /// <param name="p"></param>
  public void Method(string p){...

if you type ///< you will even get the list of available XML elements, like remarks or exemple For more informations, see http://msdn.microsoft.com/en-us/magazine/cc302121.aspx

查看更多
登录 后发表回答