Which tags are used to include inline documentation in code?


Questions by musclebai   answers by musclebai

Showing Answers 1 - 6 of 6 Answers

wabis

  • Mar 25th, 2008
 

<summary> tag.

usage :

/// <summary>

/// string usage array class.

/// </summary>

public class teststring

{

public string s;

}

when we create the object for teststring class or browse through the class explorer through intellisense we can see this documented information.

  Was this answer useful?  Yes

PeterVH

  • Aug 19th, 2011
 

Don't forget Microsoft Sandcastle, which extracts a very nice document to go along with your code.. In theory one can use a huge number of tags, but the sourcefile can become unreadable then. In that case, put the comments in a seperate file and use the tag to get the comments linked to the member.

Code
  1.         /// <summary>

  2.         /// This function <c>FooBar</c> is just to test the triple-slashes.

  3.         /// If doesn't really seem to do something..

  4.         /// </summary>

  5.         /// <param name="banana">The banana suplied of type <see cref="Class1"> Class1 </see> </param>

  6.         /// <exception cref="ArgumentNullException"><paramref name="banana" /> is <c>null</c>.</exception>

  7.         /// <example>If you are wondering what to do with the possible exception, I suggest this:

  8.         /// <code>

  9.         /// try

  10.         /// {

  11.         ///     FooBar(new Class1(5));

  12.         /// }

  13.         /// catch (Exception e)

  14.         /// {

  15.         ///     LogException(e);

  16.         /// }

  17.         /// </code>

  18.         /// </example>

  19.         /// <returns>Zhe number of ze beast</returns>

  20.         public int FooBar(Class1 banana)

  21.         {

  22.             if(banana == null)

  23.                 throw new ArgumentNullException("banana", @"banana is null!");

  24.  

  25.             //do stuff..

  26.             return 666;

  27.         }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions