Thursday, June 26, 2008

Code highlighting workflow, using free tools

This time I created the below by pasting my code into Notepad++, selected all text, and went to TextFX, TextFX Convert, Encode HTML. Lastly I added a <pre class="C#" name="code"> to the top and </pre> to the bottom and copied it all, then used Past Special in Live Writer so I could tell it to paste as HTML.

Here's the result:

		public CustomServerProvider()
{
var cnn = new SqlConnection( Properties.Settings.Default.ServerConnectionString );
Connection = cnn;

const string newAnchorVariable = "@" + SyncSession.SyncNewReceivedAnchor;
var selectNewAnchorCommand = new SqlCommand
{
CommandText =
string.Format( "SELECT {0} = min_active_rowversion() - 1",
newAnchorVariable ),
Connection = cnn
};
selectNewAnchorCommand.Parameters.Add( newAnchorVariable, SqlDbType.Timestamp ).Direction = ParameterDirection.Output;
this.SelectNewAnchorCommand = selectNewAnchorCommand;

var downloadOnlyTables = new Dictionary<string, string> { { "BillingInfo", "BillingInfoID" }, { "Employees", "EmployeeID" }, { "Projects", "ProjectID" } };


Much better in my opinion!

No comments: