<example> tag della documentazione

Il tag <example> consente di specificare un esempio di come usare un metodo o un altro membro della libreria. In genere, l'uso di questo tag implica anche il <code> tag .

Sintassi

/// <example>description</example>

Parametri

description
Descrizione dell'esempio di codice.

Osservazioni:

Compilare con /doc per elaborare i commenti della documentazione in un file.

Esempio

// xml_example_tag.cpp
// compile with: /clr /doc /LD
// post-build command: xdcmake xml_example_tag.dll

/// Text for class MyClass.
public ref class MyClass {
public:
   /// <summary>
   /// GetZero method
   /// </summary>
   /// <example> This sample shows how to call the GetZero method.
   /// <code>
   /// int main()
   /// {
   ///    return GetZero();
   /// }
   /// </code>
   /// </example>
   static int GetZero() {
      return 0;
   }
};

Vedi anche

Documentazione XML