Example #1
0
        /// <summary>
        /// Unpack the package
        /// </summary>
        public AppletManifest Unpack()
        {
            switch (this.Compression)
            {
            case "lzma":
                using (MemoryStream ms = new MemoryStream(this.Manifest))
                    using (var dfs = new LZipStream(ms, SharpCompress.Compressors.CompressionMode.Decompress, true))
                        return(AppletManifest.Load(dfs));

            case "bzip2":
                using (MemoryStream ms = new MemoryStream(this.Manifest))
                    using (var dfs = new BZip2Stream(ms, SharpCompress.Compressors.CompressionMode.Decompress, true))
                        return(AppletManifest.Load(dfs));

            case "gzip":
                using (MemoryStream ms = new MemoryStream(this.Manifest))
                    using (GZipStream dfs = new GZipStream(ms, CompressionMode.Decompress))
                        return(AppletManifest.Load(dfs));

            default:
                using (MemoryStream ms = new MemoryStream(this.Manifest))
                    using (DeflateStream dfs = new DeflateStream(ms, CompressionMode.Decompress))
                        return(AppletManifest.Load(dfs));
            }
        }
Example #2
0
 /// <summary>
 /// Initialize
 /// </summary>
 /// <param name="host"></param>
 internal void Initialize(AppletManifest host)
 {
     this.Manifest = host;
     if (this.Menus != null)
     {
         foreach (var itm in this.Menus)
         {
             itm.Initialize(host);
         }
     }
 }