C# 如何写方法描述

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8936399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 05:17:55  来源:igfitidea点击:

how to write description for method

c#visual-studio-2010.net-4.0

提问by jojo

Possible Duplicate:
XML multiline comments in C# - what am I doing wrong?
Multiline XML Comments in VB.Net and Visual Studio Intellisense

可能的重复:
C# 中的 XML 多行注释 - 我做错了什么?
VB.Net 和 Visual Studio Intellisense 中的多行 XML 注释

I want to have some description for my method

我想对我的方法进行一些描述

/// <summary> 
/// Perform a divide by b
///      e.g a = 1, b = 2
/// will return 0, since (1/2) = 0.5
/// </summary>
/// <returns>int value</returns>
public static int Div(int a, int b)
{


    return (a / b);
}

and i want the description show in the same format that i type.. however, those text will always display in oneline.

并且我希望描述显示的格式与我键入的格式相同。但是,这些文本将始终显示在一行中。

is there any tag that i can use to ask visual studio to include all those space and new line?

是否有任何标签可以用来要求 Visual Studio 包含所有这些空间和新行?

Thanks

谢谢

采纳答案by itsme86

I believe putting your lines in <para />tags works.

我相信将你的线条放在<para />标签中是有效的。

///<summary>
///<para>line1</para>
///<para>line2</para>
///</summary>