Wednesday, February 14, 2007

C# code highlighting in HTML

Just testing C# code highlighting to make code samples more readable. The C# code below has been processed with this tool. Thanks Thomas Johansen and csharpfriends.com.

List<string> portfolioIds = new List<string>();
for (int i = 0; i < temp.Length; i++)
{
if (!portfolioIds.Contains(temp[i].PortfolioId))
portfolioIds.Add(temp[i].PortfolioId);
}
List<PortFolioReportInfo2>[] portfolios = new List<PortFolioReportInfo2>[portfolioIds.Count];
for (int p = 0; p < portfolioIds.Count; p++)
{
portfolios[p] = new List<PortFolioReportInfo2>();
for (int i = 0; i < temp.Length; i++)
{
if (String.Equals(temp[i].PortfolioId, portfolioIds[p])) portfolios[p].Add(temp[i]);
}
}

No comments: