Export (0) Print
Expand All

<example>

<example>description</example>

where:

description
A description of the code sample.

Remarks

The <example> tag lets you specify an example of how to use a method or other library member. Commonly, this would involve use of the <code> tag.

Compile with /doc to process documentation comments to a file.

Example

// xml_example_tag.cs
// compile with: /doc:xml_ctag.xml

/// text for class MyClass
public class MyClass 
{
   /// <summary>
   /// The GetZero method.
   /// </summary>
   /// <example> This sample shows how to call the GetZero method.
   /// <code>
   ///   class MyClass 
   ///   {
   ///      public static int Main() 
   ///      {
   ///         return GetZero();
   ///      }
   ///   }
   /// </code>
   /// </example>
   public static int GetZero() 
   {
      return 0;
   }
   /// text for Main
   public static void Main () 
   {
   }
}

See Also

Recommended Tags for Documentation Comments

Show:
© 2014 Microsoft