private void DoWork(object sender, DoWorkEventArgs e)
{
var file = e.Argument.ToString();
if (string.IsNullOrEmpty(file))
{
return;
}
var sw = new Stopwatch();
var fi = new FileInfo(file);
if (Common.Types.ContainsKey(fi.Length))
{
SetTitle(string.Format("{0} Type: {2} File: {1}", _version, Path.GetFileName(file), Common.Types[fi.Length].Name.Value));
Common.SendStatus("Reading image into memory and checking statistics...");
Logger.LogPath = Path.GetDirectoryName(file) + "\\" + Path.GetFileNameWithoutExtension(file) + "_PS3Check.log";
Logger.WriteLine2("********************************************");
Logger.WriteLine2(_version);
Logger.WriteLine2(string.Format("Check started: {0}", DateTime.Now));
Logger.WriteLine2("********************************************");
sw.Start();
Logger.WriteLine("Reading image into memory and checking statistics...");
e.Result = Checks.StartCheck(file, ref sw);
}
else
{
Common.SendStatus("ERROR: Bad file size! Check aborted...");
}
}