예제 #1
0
파일: Unrar.cs 프로젝트: uotools/runuogdk
        protected virtual int OnDataAvailable(IntPtr p1, int p2)
        {
            int result = 1;

            if (this.currentFile != null)
            {
                this.currentFile.BytesExtracted += p2;
            }
            if (this.DataAvailable != null)
            {
                byte[] data = new byte[p2];
                Marshal.Copy(p1, data, 0, p2);
                DataAvailableEventArgs e = new DataAvailableEventArgs(data);
                this.DataAvailable(this, e);
                if (!e.ContinueOperation)
                {
                    result = -1;
                }
            }
            if ((this.ExtractionProgress != null) && (this.currentFile != null))
            {
                ExtractionProgressEventArgs e = new ExtractionProgressEventArgs();
                e.FileName        = this.currentFile.FileName;
                e.FileSize        = this.currentFile.UnpackedSize;
                e.BytesExtracted  = this.currentFile.BytesExtracted;
                e.PercentComplete = this.currentFile.PercentComplete;
                this.ExtractionProgress(this, e);
                if (!e.ContinueOperation)
                {
                    result = -1;
                }
            }
            return(result);
        }
예제 #2
0
 protected virtual int OnDataAvailable(IntPtr p1, int p2)
 {
     int result=1;
     if(this.currentFile!=null)
         this.currentFile.BytesExtracted+=p2;
     if(this.DataAvailable!=null)
     {
         byte[] data=new byte[p2];
         Marshal.Copy(p1, data, 0, p2);
         DataAvailableEventArgs e=new DataAvailableEventArgs(data);
         this.DataAvailable(this, e);
         if(!e.ContinueOperation)
             result=-1;
     }
     if((this.ExtractionProgress!=null) && (this.currentFile!=null))
     {
         ExtractionProgressEventArgs e = new ExtractionProgressEventArgs();
         e.FileName=this.currentFile.FileName;
         e.FileSize=this.currentFile.UnpackedSize;
         e.BytesExtracted=this.currentFile.BytesExtracted;
         e.PercentComplete=this.currentFile.PercentComplete;
         this.ExtractionProgress(this, e);
         if(!e.ContinueOperation)
             result=-1;
     }
     return result;
 }
예제 #3
0
 protected virtual void OnExtractionProgress(object sender, ExtractionProgressEventArgs e)
 {
     progressBar.Value = (int)(e.PercentComplete);
     lblStatus.Text    = String.Format("Extracting File: {0} {1}/{2}", e.FileName, e.BytesExtracted, e.FileSize);
 }
예제 #4
0
파일: Updater.cs 프로젝트: herculesjr/razor
 private void rar_ExtractionProgress( object sender, ExtractionProgressEventArgs e )
 {
     OnProgressChange( (int)e.PercentComplete );
 }
예제 #5
0
 private void rar_ExtractionProgress(object sender, ExtractionProgressEventArgs e)
 {
     OnProgressChange((int)e.PercentComplete);
 }
예제 #6
0
 protected virtual void OnExtractionProgress(object sender, ExtractionProgressEventArgs e)
 {
     progressBar.Value = (int)(e.PercentComplete);
     lblStatus.Text = String.Format("Extracting File: {0} {1}/{2}", e.FileName, e.BytesExtracted, e.FileSize);
 }