저장 프로세스가 있지만 추출 처리를 미러링하는 것처럼 보입니다. ExtractProgress를 처리하기 위해 아래를 변경하면 매우 유사해야합니다.
private void _archive_SaveProgress(object sender, SaveProgressEventArgs e)
{
switch (e.EventType)
{
case ZipProgressEventType.Saving_BeforeWriteEntry:
if (e.EntriesTotal > 0)
{
// Update the view with the total percentage progress.
int totalPercentage = (e.EntriesSaved/e.EntriesTotal) * 100m;
View.SavingStatus(e.CurrentEntry.FileName, 0, totalPercentage);
}
break;
case ZipProgressEventType.Saving_EntryBytesRead:
int filePercentage = 0;
if (e.BytesTransferred == 0)
{
filePercentage = 0;
}
else
{
filePercentage = (new decimal(e.BytesTransferred)/new decimal(e.TotalBytesToTransfer)) * 100m;
}
// Update the view with the current file percentage.
View.SavingStatus("Archiving file " + e.CurrentEntry.FileName + "...", filePercentage, -1);
break;
case ZipProgressEventType.Saving_Completed:
View.SavingStatus("Archive creation complete, saving data changes...", 100, 100);
break;
}
}
경우 문의 첫 번째 부분은 진행 상황을 처리하는 : 여기
은 zip 파일을 저장할 때 나는 전체 진행 상황과 현재 파일의 진행을 모두 추적하고있어 SaveProgress 이벤트의 내 처리입니다 두 번째 case 문은 현재 파일을 처리합니다. 이 경우 View.SavingStatus를 호출하면 현재 상태 텍스트로 레이블이 업데이트되고 인터페이스에서 두 개의 진행 막대가 업데이트됩니다.
고맙습니다. 유용 할 것입니다;) – Sajgoniarz