public static void DecompressAsync(string inFile, string outFile, ProgressDelegate progress = null) { Thread thread = new Thread(new ParameterizedThreadStart(DecompressInternal)); FileChangeInfo info = new FileChangeInfo() { inPath = inFile, outPath = outFile, progress = progress }; thread.Start(info); }
/// <summary> /// 解压缩内部实现 /// </summary> /// <param name="obj"></param> private static void DecompressInternal(object obj) { FileChangeInfo info = (FileChangeInfo)obj; string inpath = info.inPath; string outpath = info.outPath; CodeProgress codeProgress = null; if (info.progress != null) { codeProgress = new CodeProgress(info.progress); } Decompress(inpath, outpath, codeProgress); }