SevenZip/ArchiveExtractCallback.cs
/// <summary>
///   Called when the archive was extracted
/// </summary>
/// <param name = "operationResult"></param>
Called when the archive was extracted
Called when the archive was extracted
public void SetOperationResult(OperationResult operationResult)
        {
            if (operationResult != OperationResult.Ok && ReportErrors)
            {
                switch (operationResult)
                {
                    case OperationResult.CrcError:
                        AddException(new ExtractionFailedException("File is corrupted. Crc check has failed."));
                        break;
                    case OperationResult.DataError:
                        AddException(new ExtractionFailedException("File is corrupted. Data error has occured."));
                        break;
                    case OperationResult.UnsupportedMethod:
                        AddException(new ExtractionFailedException("Unsupported method error has occured."));
                        break;
                }
            }
            else
            {
                if (_fileStream != null && !_fileIndex.HasValue)
                {
                    try
                    {
                        _fileStream.BytesWritten -= IntEventArgsHandler;
                        _fileStream.Dispose();
                    }
                    catch (ObjectDisposedException)
                    {
                    }
                    _fileStream = null;
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                }
                var iea = new FileInfoEventArgs(
                    _extractor.ArchiveFileData[_currentIndex], PercentDoneEventArgs.ProducePercentDone(_doneRate));
                OnFileExtractionFinished(iea);
                if (iea.Cancel)
                {
                    Canceled = true;
                }
            }
        }
public void SetOperationResult ( OperationResult operationResult ) { if ( operationResult != OperationResult . Ok && ReportErrors ) { switch ( operationResult ) { case OperationResult . CrcError : AddException ( new ExtractionFailedException ( " " ) ) ; break ; case OperationResult . DataError : AddException ( new ExtractionFailedException ( " " ) ) ; break ; case OperationResult . UnsupportedMethod : AddException ( new ExtractionFailedException ( " " ) ) ; break ; } } else { if ( _fileStream != null && ! _fileIndex . HasValue ) { try { _fileStream . BytesWritten -= IntEventArgsHandler ; _fileStream . Dispose ( ) ; } catch ( ObjectDisposedException ) { } _fileStream = null ; GC . Collect ( ) ; GC . WaitForPendingFinalizers ( ) ; } var iea = new FileInfoEventArgs ( _extractor . ArchiveFileData [ _currentIndex ] , PercentDoneEventArgs . ProducePercentDone ( _doneRate ) ) ; OnFileExtractionFinished ( iea ) ; if ( iea . Cancel ) { Canceled = true ; } } }
Called when the archive was extracted
Called when the archive was extracted
operationResult
OperationResult
None