Пример #1
0
 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;
     });
 }
Пример #2
0
 public Archive(ZipType TypeOfArchive)
 {
     this.TypeOfZip = TypeOfArchive;
 }
Пример #3
0
 public ZipData(ZipType type, Action <object> callback, object[] param)
 {
     Type     = type;
     Callback = callback;
     Params   = param;
 }
Пример #4
0
 /// <summary>
 /// 开始压缩或解压数据(新线程中)
 /// </summary>
 public static void Zip(ZipType type, Action <object> callback, params object[] param)
 {
     _ZipData.Enqueue(new ZipData(type, callback, param));
     StartThread();
 }
Пример #5
0
 /** @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;
 }