Needs some modification for Silverlight 4

Jul 30, 2010 at 4:06 AM

When upgrading the project to Silverlight 4 it stops compiling, just two errors : in FileSystemScanner.cs, the method ScanDir(..) is using some IO methods that does not exist under SL4.

These methods are the one returning the list of files and directories in a folder. To compile under SL4 you will need to change these call to Directory.EnumerateFiles(directory) and Directory.EnumeratesDirectories(directory).

But this simple change is not enough, you'll have to adapt the code to use these new methods that are not returning a string array (originaly needed bu the code) but a IEnumerable : so direct access to an element, has the code is doing, is not possible. There are a few ways to change this, the simplest is to get the files from EnumerateFiles and to fill the names[] array, so current code can work. For directories it is much simpler since current code is not modifying indexed items, just iterating through the list, so changing the string array into an IEnumerable will directly fit with current code.

It will be cool if this project will be alive... SharpZipLib has certainly been modified since it was used in this SL version. SL has also changed since V 2 ! Nobody here to follow this useful project ?

Aug 14, 2010 at 7:51 AM


I have taken over maintenance of the project and there is a new build posted.

Let us know how it works out for you.