Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
C-sharp language specification.2004.pdf
Скачиваний:
14
Добавлен:
23.08.2013
Размер:
2.55 Mб
Скачать

C# LANGUAGE SPECIFICATION

1/// <summary>

2/// This method changes the Point's location to the given coordinates.

3/// </summary>

4/// <param name="xor">The new x-coordinate.</param>

5/// <param name="yor">The new y-coordinate.</param>

6public void Move(int xor, int yor) {

7

X = xor;

8Y = yor;

9}

10E.2.8 <paramref>

11This tag is used to indicate that a word is a parameter. The documentation file can be processed to format

12this parameter in some distinct way.

13Syntax:

14<paramref name="name"/>

15where

16name

17The name of the parameter.

18Example:

19/// <summary>

20/// This constructor initializes the new Point to

21/// (<paramref name="xor"/>,<paramref name="yor"/>).

22/// </summary>

23/// <param name="xor">The new Point's x-coordinate.</param>

24/// <param name="yor">The new Point's y-coordinate.</param>

25public Point(int xor, int yor) {

26

X = xor;

27Y = yor;

28}

29E.2.9 <permission>

30This tag allows the security accessibility of a member to be documented.

31Syntax:

32<permission cref="member">description</permission>

33where

34member

35The name of a member. The documentation generator checks that the given code element exists and

36translates member to the canonical element name in the documentation file.

37description

38A description of the access to the member.

39Example:

40/// <permission cref="System.Security.PermissionSet">

41/// Everyone can access this method.

42/// </permission>

43public static void Test() {

44

45}

46E.2.10 <remarks>

47This tag is used to specify overview information about a type. Use <summary> (§E.2.14) to describe the

48members of a type.

49Syntax:

516

Annex E Documentation Comments

1<remarks>text</remarks>

2where

3text

4The text of the remarks.

5Example:

6/// <remarks>

7/// Class <c>Point</c> models a point in a two-dimensional plane.

8/// </remarks>

9public class Point

10{

11

12}

13E.2.11 <returns>

14This tag is used to describe the return value of a method.

15Syntax:

16<returns>description</returns>

17where

18description

19A description of the return value.

20Example:

21/// <summary>

22/// Report a Point's location as a string.

23/// </summary>

24/// <returns>

25/// A string representing a Point's location, in the form (x,y),

26/// without any leading, training, or embedded whitespace.

27/// </returns>

28public override string ToString() {

29return "(" + X + "," + Y + ")";

30}

31E.2.12 <see>

32This tag allows a link to be specified within text. Use <seealso> (§E.2.13) to indicate text that is to appear

33in a See Also subclause.

34Syntax:

35<see cref="member"/>

36where

37member

38The name of a member. The documentation generator checks that the given code element exists and

39passes member to the element name in the documentation file.

40Example:

41/// <summary>

42/// This method changes the Point's location to the given coordinates.

43/// Use the <see cref="Translate"/> method to apply a relative change.

44/// </summary>

45public void Move(int xor, int yor) {

46

X = xor;

47Y = yor;

48}

517

C# LANGUAGE SPECIFICATION

1/// <summary>

2/// This method changes the Point's location by the given offsets.

3/// Use the <see cref="Move"/> method to directly set the coordinates.

4/// </summary>

5public void Translate(int xor, int yor) {

6

X += xor;

7Y += yor;

8}

9E.2.13 <seealso>

10This tag allows an entry to be generated for the See Also subclause. Use <see> (§E.2.12) to specify a link

11from within text.

12Syntax:

13<seealso cref="member"/>

14where

15member

16The name of a member. The documentation generator checks that the given code element exists and

17passes member to the element name in the documentation file.

18Example:

19/// <summary>

20/// This method determines whether two Points have the same location.

21/// </summary>

22/// <seealso cref="operator =="/>

23/// <seealso cref="operator !="/>

24public override bool Equals(object o) {

25

26}

27E.2.14 <summary>

28This tag can be used to describe a member for a type. Use <remarks> (§E.2.10) to describe the type itself.

29Syntax:

30<summary>description</summary>

31where

32description

33A summary of the member.

34Example:

35/// <summary>

36/// This constructor initializes the new Point to (0,0).

37/// </summary>

38public Point(): this(0,0) {

39}

40E.2.15 <value>

41This tag allows a property to be described.

42Syntax:

43<value>property description</value>

44where

45property description

46A description for the property.

47Example:

518

Соседние файлы в предмете Электротехника