public ZipProcess(string _sourceFile, string _targetPath, ZipType type = ZipType.UNZIP) { SourcePath = _sourceFile; TargetPath = _targetPath; _task = new Task <bool>(() => { IsStart = true; //ZipHelper zh = new ZipHelper(); //return zh.UnZip(SourcePath, TargetPath,ref successCount,ref AllCount); if (type == ZipType.UNZIP) { return(UnZip(SourcePath, TargetPath)); } else { return(ZipFiles(SourcePath, TargetPath)); } }); _task.ContinueWith(i => { IsSuccess = i.Result; IsOver = true; }); }
public Archive(ZipType TypeOfArchive) { this.TypeOfZip = TypeOfArchive; }
public ZipData(ZipType type, Action <object> callback, object[] param) { Type = type; Callback = callback; Params = param; }
/// <summary> /// 开始压缩或解压数据(新线程中) /// </summary> public static void Zip(ZipType type, Action <object> callback, params object[] param) { _ZipData.Enqueue(new ZipData(type, callback, param)); StartThread(); }
/** @brief Constructor for the zip archive type. * * @param TypeOfArchive ZipType Determines whether or not the zip to be created or extract is a Windows Zip archive or a GZip archive. * */ public Archive(ZipType TypeOfArchive) { this.TypeOfZip = TypeOfArchive; }