J-Pizzie Lifestyle

More digital sillynonsense from Jeff Putz

Member's time: 2/28/2008 10:51:59 PM

I'd like to document the class library for POP Forums because it just looks more professional and it's certainly easier to use that way. It's also a pain in the ass.

I knew there was a Visual Studio plug-in called Ghost Doc that would by some miracle create documentation for you if you were using standard and widely accepted naming conventions, or just needed it to generate the obvious text. In C# we can put this stuff right next to the various class and method declarations as specially formatted comments, and then when you compile, an XML file is generated from which any number of tools generate pages of docs.

So I have a static method in my utility class that looks like this...

public static bool IsInteger(string testString)
{
if (testString == null) return false;
Regex regexNumber = new Regex("^[-]?[0-9]+$");
return regexNumber.IsMatch(testString);
}[/0-9][/-]

It knew exactly what to do...

/// <summary>
/// Determines whether the specified test string is integer.
/// </summary>
/// <param name="testString">The test string.</param>
/// <returns>
/// <c>true</c> if the specified test string is integer; otherwise, <c>false</c>.
/// </returns>

That's f'ing sweet.

Comments

2/29/2008 8:24:45 AM

That is sexy.

Compose your comment here:

Name:
URL (include http://):

Submit comment

©2007, POP World Media, LLC - CampusFish Home