Thursday, February 22, 2007

NDoc is still dead but...

...not all so bad. Today I have found worth substituter of it called SandCastle.
http://www.codeproject.com/dotnet/SandcastleBuilder.asp
Even Microsoft uses it to generate internal documentation :) So I will too.

Tuesday, February 13, 2007

Convert System.Drawing.Color to HTML (#xxxxxx) representation


private string getHexColor(Color cl)
{
string clR;
string clG;
string clB;
if (cl.R == 0) clR = "00"; else clR = cl.R.ToString("x");
if (cl.G == 0) clG = "00"; else clG = cl.G.ToString("x");
if (cl.B == 0) clB = "00"; else clB = cl.B.ToString("x");
return "#" + clR + clG + clB;
}