private void btnTestSize_Click(object sender, EventArgs e)
{
PakEditor pak = null;
try
{
pak = new PakEditor(_pakFormat);
}
catch (Exception ex)
{
showException("PAK Load Error", ex);
return;
}
string saveQbName = string.Empty;
try
{
int skipped = 0;
foreach (PakHeaderItem phi in _pakFile.Headers.Values)
{
saveQbName = string.Format(@"C:\gh3temp\__\{0}", phi.Filename.Replace(@"\", "#"));
if (phi.PakFileType == PakItemType.Qb || phi.PakFileType == PakItemType.Sqb || phi.PakFileType == PakItemType.Midi)
{
_pakFile.ExtractFile(phi.Filename, saveQbName);
testQbFile(saveQbName);
}
else
skipped++;
}
int c = (pak.Headers.Values.Count - skipped);
MessageBox.Show(this, string.Format("PAK and {0} QB file{1} validated succesfully, {2} skipped", c.ToString(), c == 1 ? "" : "s", skipped.ToString()), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
showError("Test Size Error", string.Format("{0} in '{1}'", ex.Message, saveQbName));
return;
}
}