Archive for the ‘c#’ Category
Source Code Formatting
When I decided to set up this blog, the first thing I thought was: “how am I going to format my c# code blocks on the web?”. After some googling, I found this really nice site that, apparently, did just what I needed. It formats c#, vb, html and even t-sql. The only drawback for me is that it uses CSS classes. WordPress and other free blogs do not support that.
Thankfully, the author had posted the source code, so I tweaked it a little bit and created a simple windows app to format the code without CSS classes.
Here’s a screenshot:
And here’s a proof it works:
using System; using System.Collections.Generic; using System.Text; using System.Web.UI; using System.Web.UI.WebControls; namespace Common { /// <summary> /// Comments here /// </summary> [Serializable] public class FieldManager { private Dictionary<string, Field> _controlList; public FieldManager() { _controlList = new Dictionary<string, Field>(); } } }
If you like it, get the source files here.
Hope this helps,
Cassio
Leave a Comment