SevenZipTestForms - Target Framework 2.0

Jun 17, 2009 at 9:05 AM

Hi Vadim !

First of all - many thanks for the great .NET wrapper for 7zip.
Since the "SevenZip" target is 2.0, I wondered why the target for "SevenZipTestForms" is 3.5 ?

As far as I can see, there's only one call in "b_ExtractBrowseArchive_Click" which is not available in 2.0.
There's no "ToArray" method in "ReadOnlyCollection". See following suggestion for an alternative.

private void b_ExtractBrowseArchive_Click(object sender, EventArgs e)
{
    if (ofd_Archive.ShowDialog() == DialogResult.OK)
    {
        tb_ExtractArchive.Text = ofd_Archive.FileName;
        using (SevenZipExtractor extr = new SevenZipExtractor(ofd_Archive.FileName))
        {
            tb_Messages.Lines = new string[extr.ArchiveFileNames.Count];
            extr.ArchiveFileNames.CopyTo(tb_Messages.Lines, 0);
        }
    }
}

Best regards.
-- johziegler

Coordinator
Jun 17, 2009 at 9:19 AM
Edited Jun 17, 2009 at 9:27 AM

johziegler, thank you.

When I was asked to include a GUI example, I created a new Windows Forms project as usual and forgot to target the 2.0 framework :) I committed the 2.0 project with your suggested fix, thanks.

Jun 17, 2009 at 9:50 AM

No problem. Thanx for the fast response.

c u here