public override void Render(Graphics g, Rectangle r)
{
ApplicationJob job = RowObject as ApplicationJob;
// Do not draw anything if the updater is not currently working
if (m_Updater.GetProgress(job) == -1)
{
base.DrawBackground(g, r);
return;
}
base.Render(g, r);
long fileSize = m_Updater.GetDownloadSize(job);
// No file size has been determined yet
if (fileSize == -2)
{
return;
}
using (Brush fontBrush = new SolidBrush(SystemColors.WindowText))
{
StringFormat format = new StringFormat();
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Center;
string text = FormatFileSize.Format(fileSize);
if (fileSize < 0)
{
text = "(unknown)";
}
g.DrawString(text, new Font(this.Font, FontStyle.Bold), fontBrush, r, format);
}
}