private void PackBrowser_Shown(object sender, EventArgs e)
{
m_Tree.Enabled = false;
// Insert File tree
try
{
m_Pack = PackResourceSet.CreateFromFile(PackFile);
if (m_Pack != null)
{
Status.Text = Properties.Resources.Str_Initialize;
this.Text = this.PackFile + " - MabiPacker";
uint files = m_Pack.GetFileCount();
this.pd.Maximum = files;
this.pd.Caption = Properties.Resources.Str_Loading;
this.pd.Animation = 151;
this.Update();
m_Tree.BeginUpdate();
m_Tree.Nodes.Clear();
m_Root = m_Tree.Nodes.Add("data", "data", 0, 0);
for (uint i = 0; i < files; ++i)
{
InsertFileNode(i);
string info = String.Format(Properties.Resources.Str_LoadingMsg, i, files);
this.pd.Value = i;
this.pd.Message = info;
Status.Text = info;
if (this.pd.HasUserCancelled)
{
m_Pack.Dispose();
this.Close();
this.pd.CloseDialog();
return;
}
this.Update();
}
m_Root.Expand();
m_Tree.EndUpdate();
this.pd.CloseDialog();
this.Update();
this.pd.Animation = 150;
this.pd.ShowDialog(ProgressDialog.PROGDLG.MarqueeProgress, ProgressDialog.PROGDLG.NoCancel);
this.pd.Caption = Properties.Resources.Str_Sorting;
this.pd.Message = Properties.Resources.Str_SortingMsg;
m_Tree.Sort();
m_Tree.Refresh();
Status.Text = Properties.Resources.Str_Ready;
this.Update();
}
m_Tree.Enabled = true;
}
catch (Exception ex)
{
d.Error(ex, this.Name);
}
finally
{
this.pd.CloseDialog();
}
}