public async Task UnzipCatrobatPackageIntoIsolatedStorage(Stream zipStream, string localStoragePath)
{
using (var storage = StorageSystem.GetStorage())
{
using (var archive = new ZipArchive(zipStream, ZipArchiveMode.Read))
{
foreach (var entry in archive.Entries)
{
using (var stream = entry.Open())
{
var skipFile = false;
foreach (var ending in SkipedEndings)
if (entry.Name.EndsWith(ending))
skipFile = true;
if (skipFile)
continue;
var filePath = Path.Combine(localStoragePath, entry.FullName);
if (Path.GetFileName(filePath) == "") continue;
var outStream = await storage.OpenFileAsync(filePath,
StorageFileMode.CreateNew, StorageFileAccess.Write);
await stream.CopyToAsync(outStream);
outStream.Dispose();
stream.Dispose();
}
}
}
}
}