Friday, January 11, 2008

C# method documentation

Maybe you have known about this, but I just found that you could put this before a method.
/// <summary></summary>
/// <param name="field"></param>
/// <param name="msg"></param>
/// <param name="min"></param>
/// <param name="max"></param>
/// <param name="validator"></param>
/// <returns></returns>

I just put this before my method "isValidIntegerRng".
/// <summary>
/// check if an integer field is valid and within range, the field is optional
/// </summary>
When I made the call to this method, I wasn't sure if the field is optional or not. This way you can hover over the method call and see the comment so you don't need to open the class to see it.

1 comment:

glayla said...

That's a great tip! Thanks!