Exemplo n.º 1
0
        void ReadSkinFromStream(Stream stream)
        {
            var zipStream = new ZipInputStream(stream);

            ZipEntry file;

            while ((file = zipStream.GetNextEntry()) != null)
            {
                using (var ms = zipStream.ReadAll()) {
                    var ext = file.Name.SubstringAfterLast('.').ToLower();
                    switch (ext)
                    {
                    case "jpg":
                    case "jpeg":
                    case "png":
                    case "gif":
                        StoreImage(file.Name, ms);
                        break;

                    case "xml":
                        StoreXml(ms);
                        break;

                    default:
                        break;
                    }
                }
            }
            InvokeSkinReady();
        }