It's possible to generate documents according to your project as clean and fast as possible. In fact, Visual studio offers the possibility to insert tags into the code editor as mentioned below:

Figure 1
As you can see every class member should be decorated by those tags in order to be documented later. Documentation could be ventilated toward HTML files using the XSLT transformation in order to obtain a sort of a web site that could be used locally to browse through the details of your project. Indeed, this sort of documentation is called NDOC it's very similar to the JAVA DOC if you're coming from Java developments back ground.
Walkthrough:
I propose this walkthrough to illustrate how to build such documentation:
First, create a new console application and add this code:
using System;
using System.Collections.Generic;
using System.Text;
/** The namespace DocumentGenerate */
namespace DocumentGenerate
{
/// <summary>
/// This is the Program class that contains the main method
/// </summary>
class Program
{
/// <summary>
/// The entry point method it's static
/// </summary>
/// <param name="args">string: string of arguments</param>
static void Main(string[] args)
{
Arithmetic Ar = new Arithmetic(36, 3);
int sum = Ar.Sum();
int dif = Ar.Diff(true);
int mul = Ar.Mult();
double div = Ar.Div(true);
Console.WriteLine(string.Format("Numners are {0} and {1}",Ar.a,Ar.b));
Console.WriteLine(string.Format("{0} + {1} = {2}",Ar.a,Ar.b,Ar.Sum()));
Console.WriteLine(string.Format("{0} - {1} = {2}", Ar.a, Ar.b, Ar.Diff(true)));
Console.WriteLine(string.Format("{0} * {1} = {2}", Ar.a, Ar.b, Ar.Mult()));
Console.WriteLine(string.Format("{0} / {1} = {2}", Ar.a, Ar.b, Ar.Div(true)));
Console.Read();
}
}
/// <summary>
/// Arithmetic: This class helps to perform basic arithmetic operations
/// </summary>
public class Arithmetic
{
/// <summary>
/// Integer : Private field that represents the first operand
/// </summary>
private int _a;
/// <summary>
/// Integer : Private field that represent the second operand
/// </summary>
private int _b;
/// <summary>
/// Constructor: Default constructor
/// </summary>
public Arithmetic() { }
/// <summary>
/// Constructor: Constructor that recieves two operands
/// </summary>
/// <param name="a">a : First operand</param>
/// <param name="b">b : Second operand</param>
public Arithmetic(int a, int b)
{
this.a = a;
this.b = b;
}
/// <summary>
/// Integer: This is the first operand public propertie
/// </summary>
public int a
{
get { return _a; }
set {_a = value; }
}
/// <summary>
/// Integer: This is the second operand public propertie
/// </summary>
public int b
{
get { return _b; }
set { _b = value; }
}
/// <summary>
/// Method: For additon operations
/// </summary>
/// <returns>Integer: The sum of to integer</returns>
public int Sum()
{
return a + b;
}
/// <summary>
/// Method:
/// </summary>
/** <param name="FirstMinusSecond">Boolean : Indicates if
* the a should be at first position</param>*/
/// <returns>Integer: Difference between to integers</returns>
public int Diff(bool FirstMinusSecond)
{
FirstMinusSecond = true;
if (FirstMinusSecond)
return a - b;
else
return b - a;
}
/// <summary>
/// Method : Multiply two integers
/// </summary>
/// <returns>Integer: Multiplication of two integers</returns>
public int Mult()
{
return a * b;
}
/// <summary>
/// Method : Divide one integer by another integer
/// </summary>
/** <param name="FirstDivSecond">Boolean: Indicates if
* the first operand should be a
* </param>*/
/// <returns>Double: Division of two integers</returns>
public double Div(bool FirstDivSecond)
{
FirstDivSecond = true;
if (FirstDivSecond)
{
try
{
return a / b;
}
catch(DivideByZeroException caught)
{
Console.WriteLine(caught.Message);
return 0;
}
}
if (!FirstDivSecond)
{
try
{
return b / a;
}
catch (DivideByZeroException caught)
{
Console.WriteLine(caught.Message);
return 0;
}
}
else return 0;
}
}
}
This project is composed by two classes, the class Program and the class Arithmetic that can perform some arithmetic operations. In order to generate an xml that contains the project documentation do as follow:







Join the conversation! Your thoughts help the community grow.