Commonly used utility code for C#.