private void ProcessFileEndCallback(int processId, int fileId, TrrntZipStatus trrntZipStatus) { if (InvokeRequired) { BeginInvoke(new ProcessFileEndCallback(ProcessFileEndCallback), processId, fileId, trrntZipStatus); return; } if (processId == -1) { scanningForFiles = false; if (FileCount == 0) { StopWorking(); } } else { _threads[processId].tProgress = 100; if ((fileId + 1) > tGridMax) { tGridMax = (fileId + 1); } dGrid tGridn = new dGrid() { fileId = fileId, filename = null }; switch (trrntZipStatus) { case TrrntZipStatus.ValidTrrntzip: tGridn.status = "Valid TrrntZip"; break; case TrrntZipStatus.Trrntzipped: tGridn.status = "TrrntZipped"; break; default: tGridn.status = trrntZipStatus.ToString(); break; } tGrid.Add(tGridn); if (!scanningForFiles && (fileId + 1) == FileCount) { StopWorking(); } } }
private void SetFileStatusCallback(int processId, int fileId, TrrntZipStatus trrntZipStatus) { if (InvokeRequired) { BeginInvoke(new SetFileStatusCallback(SetFileStatusCallback), processId, fileId, trrntZipStatus); return; } switch (trrntZipStatus) { case TrrntZipStatus.ValidTrrntzip: dataGrid.Rows[fileId].Cells[1].Value = "Valid TrrntZip"; break; case TrrntZipStatus.Trrntzipped: dataGrid.Rows[fileId].Cells[1].Value = "TrrntZipped"; break; default: dataGrid.Rows[fileId].Cells[1].Value = trrntZipStatus.ToString(); break; } }