public static BuildReportTool.SizePart CreateSizePartFromFile(string filename, string fileFullPath)
{
BuildReportTool.SizePart outPart = new BuildReportTool.SizePart();
outPart.Name = System.Security.SecurityElement.Escape(filename);
if (File.Exists(fileFullPath))
{
int fileSizeBytes = GetFileSizeInBytes(fileFullPath);
outPart.SizeBytes = fileSizeBytes;
outPart.Size = GetBytesReadable(fileSizeBytes);
}
else
{
outPart.SizeBytes = -1;
outPart.Size = "???";
}
/// \todo perhaps compute percentage: file size of this DLL out of total build size (would need to convert string of total build size into an int of bytes)
outPart.Percentage = -1;
return outPart;
}