Ejemplo n.º 1
0
        public Task <bool> Run()
        {
            try
            {
                _file.MoveTo(_file.FullName + "-unpacked");
                using (ZipInputStream zipStream = new ZipInputStream(new ProgressStream(_file.OpenRead(), this)))
                {
                    zipStream.UnpackAll(_file.Directory);
                }

                return(Task.FromResult(true));
            }
            catch (Exception)
            {
                return(Task.FromResult(false));
            }
        }
Ejemplo n.º 2
0
        public Task <bool> Run()
        {
            try
            {
                using (ZipInputStream zipStream = new ZipInputStream(new ProgressStream(_file.OpenRead(), this)))
                {
                    zipStream.UnpackAll(
                        _file.Directory.CreateSubdirectory(Path.GetFileNameWithoutExtension(_file.Name)));
                }

                return(Task.FromResult(true));
            }
            catch (Exception e)
            {
                return(Task.FromResult(false));
            }
        }