Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.

Wednesday, November 14, 2007

Well documented C# code sample

Well documented C# code sample demonstrates region, summary, and parameter documentation.


#region well documented sample method sample
/// <summary>
/// Saves the form size when it is resized.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SampleBrowser_SizeChanged(object sender, EventArgs e)
{
Properties.Settings.Default.FormClientSize = this.ClientSize;
}

/// <summary>
/// Saves all settings when form is closed.
/// </summary>
#endregion

Note: In addition to "param", one can use:

/// <returns>State of log in</returns>

Also: The #endregion must be on a new line!

1 comment:

Maxime said...

Well written article.