Ejemplo n.º 1
0
		/// <summary>
		/// Raise the complete file event
		/// </summary>
		/// <param name="file">The file name</param>
		void OnCompleteFile(string file)
		{
			CompletedFileHandler handler = CompletedFile;

			if (handler != null) {
				var args = new ScanEventArgs(file);
				handler(this, args);
				alive_ = args.ContinueRunning;
			}
		}
Ejemplo n.º 2
0
        private void OnCompleteFile(string file)
        {
            CompletedFileHandler completedFile = CompletedFile;

            if (completedFile != null)
            {
                ScanEventArgs e = new ScanEventArgs(file);
                completedFile(this, e);
                alive_ = e.ContinueRunning;
            }
        }
Ejemplo n.º 3
0
        // Token: 0x0600079C RID: 1948 RVA: 0x0002C5BC File Offset: 0x0002A7BC
        private void OnCompleteFile(string file)
        {
            CompletedFileHandler completedFile = this.CompletedFile;

            if (completedFile != null)
            {
                ScanEventArgs scanEventArgs = new ScanEventArgs(file);
                completedFile(this, scanEventArgs);
                this.alive_ = scanEventArgs.ContinueRunning;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Fires the <see cref="CompletedFile"/> delegate
        /// </summary>
        /// <param name="file">The file whose processing has been completed.</param>
        /// <returns>A boolean indicating if execution should continue or not.</returns>
        public bool OnCompletedFile(string file)
        {
            bool result = true;
            CompletedFileHandler handler = CompletedFile;

            if (handler != null)
            {
                ScanEventArgs args = new ScanEventArgs(file);
                handler(this, args);
                result = args.ContinueRunning;
            }
            return(result);
        }
Ejemplo n.º 5
0
        public bool OnCompletedFile(string file)
        {
            bool result = true;
            CompletedFileHandler completedFile = CompletedFile;

            if (completedFile != null)
            {
                ScanEventArgs scanEventArgs = new ScanEventArgs(file);
                completedFile(this, scanEventArgs);
                result = scanEventArgs.ContinueRunning;
            }
            return(result);
        }
Ejemplo n.º 6
0
        public bool OnCompletedFile(string file)
        {
            bool continueRunning = true;
            CompletedFileHandler completedFile = CompletedFile;

            if (completedFile != null)
            {
                ScanEventArgs e = new ScanEventArgs(file);
                completedFile(this, e);
                continueRunning = e.ContinueRunning;
            }
            return(continueRunning);
        }
Ejemplo n.º 7
0
    static bool UncompressByFastZip(string orgPath, string tarPath, CompletedFileHandler progressFileHandle = null)
    {
        bool res = true;

        try
        {
            FastZipEvents events = new FastZipEvents();
            if (progressFileHandle != null)
            {
                events.CompletedFile = progressFileHandle;
            }

            FastZip zipfile2 = new FastZip(events);
            zipfile2.ExtractZip(orgPath, tarPath, "");
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
            res = false;
        }

        return(res);
    }
Ejemplo n.º 8
0
        /// <summary>
        /// 快速解压
        /// </summary>
        /// <param name="zipFilePath">压缩文件路径</param>
        /// <param name="extractPath">解压路径</param>
        /// <param name="pwd">密码</param>
        /// <param name="progressFun">进程</param>
        /// <param name="seconds">触发时间</param>
        /// <param name="completeFun">压缩过程中执行的函数</param>
        public static void UnZip(string zipFilePath, string extractPath, string pwd, ProgressHandler progressFun, double seconds, CompletedFileHandler completeFun)
        {
            FastZipEvents events = new FastZipEvents();

            if (progressFun != null)
            {
                events.Progress         = progressFun;
                events.ProgressInterval = TimeSpan.FromSeconds(seconds);
            }
            if (completeFun != null)
            {
                events.CompletedFile = completeFun;
            }
            FastZip zip = new FastZip(events);

            zip.CreateEmptyDirectories = true;
            if (!string.IsNullOrEmpty(pwd))
            {
                zip.Password = pwd;
            }
            zip.UseZip64 = UseZip64.On;
            zip.RestoreAttributesOnExtract = true;
            zip.RestoreDateTimeOnExtract   = true;
            zip.ExtractZip(zipFilePath, extractPath, FastZip.Overwrite.Always, null, "", "", true);
        }