Changeset 1688


Ignore:
Timestamp:
1/25/2010 12:55:15 PM (4 years ago)
Author:
lowjoel
Message:

Fixed ArgumentOutOfRangeException? when erasing. Instead of assigning the Total and Completed fields to be equal, I've included the MarkComplete? function which indicates to the parent progress manager, if any, that the task has completed.

Location:
trunk/eraser6
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Manager/DirectExecutor.cs

    r1676 r1688  
    402402                    delegate(int currentFile, int totalFiles, string currentFilePath) 
    403403                    { 
    404                         tipSearch.Completed = tipSearch.Total; 
     404                        tipSearch.MarkComplete(); 
    405405                        tipProgress.Total = totalFiles; 
    406406                        tipProgress.Completed = currentFile; 
     
    482482 
    483483                //Mark the main bulk of the progress as complete 
    484                 mainProgress.Completed = mainProgress.Total; 
     484                mainProgress.MarkComplete(); 
    485485 
    486486                //Erase old resident file system table files 
     
    502502                ); 
    503503 
    504                 residentProgress.Completed = residentProgress.Total = 1; 
     504                residentProgress.MarkComplete(); 
    505505            } 
    506506            finally 
     
    513513                    new TaskProgressChangedEventArgs(string.Empty, 0, 0))); 
    514514                fsManager.DeleteFolder(info); 
    515                 tempFiles.Completed = tempFiles.Total = 1; 
     515                tempFiles.Completed = tempFiles.Total; 
    516516            } 
    517517 
     
    537537            ); 
    538538 
    539             structureProgress.Completed = structureProgress.Total; 
     539            structureProgress.MarkComplete(); 
    540540            target.Progress = null; 
    541541        } 
     
    612612                                throw new OperationCanceledException(S._("The task was cancelled.")); 
    613613 
     614                            step.Total = totalData; 
    614615                            step.Completed += lastWritten; 
    615                             step.Total = totalData; 
    616616                            task.OnProgressChanged(target, 
    617617                                new ProgressChangedEventArgs(step, 
     
    623623                    if (fileInfo != null) 
    624624                        fsManager.DeleteFile(fileInfo); 
    625                     step.Completed = step.Total = 1; 
     625                    step.MarkComplete(); 
    626626                } 
    627627                catch (UnauthorizedAccessException) 
  • trunk/eraser6/Eraser.Manager/ProgressManager.cs

    r1680 r1688  
    9696    { 
    9797        /// <summary> 
     98        /// Marks this task as complete. 
     99        /// </summary> 
     100        public void MarkComplete() 
     101        { 
     102            if (total == 0) 
     103                completed = total = 1; 
     104            else 
     105                completed = total; 
     106        } 
     107 
     108        /// <summary> 
    98109        /// Gets or sets the number of work units already completed. 
    99110        /// </summary> 
  • trunk/eraser6/Eraser/UpdateForm.cs

    r1675 r1688  
    731731 
    732732                        //Let the event handler know the download is complete. 
    733                         step.Completed = step.Total; 
     733                        step.MarkComplete(); 
    734734                        OnProgress(new ProgressEventArgs(step.Progress, progress.Progress, 
    735735                            update, S._("Downloaded: {0}", update.Name))); 
Note: See TracChangeset for help on using the changeset viewer.