Changeset 2468


Ignore:
Timestamp:
3/13/2012 4:44:12 AM (3 years ago)
Author:
lowjoel
Message:

Instead of pushing events to the client, we will update our Progress object and the client should pull progress updates instead. This prepares the code to be used by the remote executor (for service execution).

In the interim, there is no progress feedback for all erasures.

Location:
branches/eraser6/pluginsRewrite
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/DriveErasureTarget.cs

    r2464 r2468  
    210210                    { 
    211211                        Progress.Completed += lastWritten; 
    212                         OnProgressChanged(this, new ProgressChangedEventArgs(Progress, 
    213                             new TaskProgressChangedEventArgs(ToString(), currentPass, method.Passes))); 
     212                        /*OnProgressChanged(this, new ProgressChangedEventArgs(Progress, 
     213                            new TaskProgressChangedEventArgs(ToString(), currentPass, method.Passes)));*/ 
    214214 
    215215                        if (Task.Canceled) 
  • branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/ErasureTargetBase.cs

    r2467 r2468  
    6161        public abstract void Execute(); 
    6262 
     63        public ProgressManagerBase Progress 
     64        { 
     65            get; 
     66            protected set; 
     67        } 
    6368        #endregion 
    6469 
     
    130135        } 
    131136         
    132          
    133137        /// <summary> 
    134138        /// The backing variable for the <see cref="Method"/> property. 
  • branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/FileSystemObjectErasureTarget.cs

    r2464 r2468  
    247247                //Update the task progress 
    248248                IErasureMethod method = EffectiveMethod; 
    249                 OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
    250                     new TaskProgressChangedEventArgs(info.FullName, 0, method.Passes))); 
     249                /*OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
     250                    new TaskProgressChangedEventArgs(info.FullName, 0, method.Passes)));*/ 
    251251 
    252252                //Remove the read-only flag, if it is set. 
     
    263263                        progress.Total = totalData; 
    264264                        progress.Completed += lastWritten; 
    265                         OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
    266                             new TaskProgressChangedEventArgs(info.FullName, currentPass, method.Passes))); 
     265                        /*OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
     266                            new TaskProgressChangedEventArgs(info.FullName, currentPass, method.Passes)));*/ 
    267267                    }; 
    268268 
  • branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs

    r2464 r2468  
    219219 
    220220            //Public progress updates. 
    221             OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
    222                 new TaskProgressChangedEventArgs(info.FullName, 0, 0))); 
     221            /*OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
     222                new TaskProgressChangedEventArgs(info.FullName, 0, 0)));*/ 
    223223 
    224224            //Ensure that the current directory is empty before deleting. 
  • branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/RecycleBinErasureTarget.cs

    r2463 r2468  
    130130            Progress.Steps.Add(new SteppedProgressManagerStep(progress, 
    131131                0.0f, S._("Emptying recycle bin..."))); 
    132             OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
    133                 new TaskProgressChangedEventArgs(string.Empty, 0, 0))); 
     132            /*OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
     133                new TaskProgressChangedEventArgs(string.Empty, 0, 0)));*/ 
    134134 
    135135            RecycleBin.Empty(EmptyRecycleBinOptions.NoConfirmation | 
  • branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTarget.cs

    r2463 r2468  
    236236 
    237237                //Update progress. 
    238                 OnProgressChanged(this, new ProgressChangedEventArgs(folderDeleteProgress, 
    239                     new TaskProgressChangedEventArgs(subDirectory.FullName, 1, 1))); 
     238                /*OnProgressChanged(this, new ProgressChangedEventArgs(folderDeleteProgress, 
     239                    new TaskProgressChangedEventArgs(subDirectory.FullName, 1, 1)));*/ 
    240240 
    241241                //Get the directory which we copied to and copy the file times to the 
     
    342342            progress.Completed = TotalBytesTransferred; 
    343343            progress.Total = TotalFileSize; 
    344             OnProgressChanged(this, new ProgressChangedEventArgs(Progress, 
    345                 new TaskProgressChangedEventArgs(file.FullName, 1, 1))); 
     344            /*OnProgressChanged(this, new ProgressChangedEventArgs(Progress, 
     345                new TaskProgressChangedEventArgs(file.FullName, 1, 1)));*/ 
    346346 
    347347            if (Task.Canceled) 
  • branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/UnusedSpaceErasureTarget.cs

    r2463 r2468  
    196196                        throw new OperationCanceledException(S._("The task was cancelled.")); 
    197197 
    198                     OnProgressChanged(this, new ProgressChangedEventArgs(tipSearch, 
    199                         new TaskProgressChangedEventArgs(path, 0, 0))); 
     198                    //TODO: create a means to inform the parent on the progress of the current 
     199                    //file we found 
     200                    /*OnProgressChanged(this, new ProgressChangedEventArgs(tipSearch, 
     201                        new TaskProgressChangedEventArgs(path, 0, 0)));*/ 
    200202                }; 
    201203 
     
    209211                        tipProgress.Total = totalFiles; 
    210212                        tipProgress.Completed = currentFile; 
    211                         OnProgressChanged(this, new ProgressChangedEventArgs(tipProgress, 
    212                             new TaskProgressChangedEventArgs(currentFilePath, 0, 0))); 
     213                        /*OnProgressChanged(this, new ProgressChangedEventArgs(tipProgress, 
     214                            new TaskProgressChangedEventArgs(currentFilePath, 0, 0)));*/ 
    213215 
    214216                        if (Task.Canceled) 
     
    247249                        residentProgress.Completed = currentFile; 
    248250                        residentProgress.Total = totalFiles; 
    249                         OnProgressChanged(this, new ProgressChangedEventArgs(residentProgress, 
    250                             new TaskProgressChangedEventArgs(string.Empty, 0, 0))); 
     251                        /*OnProgressChanged(this, new ProgressChangedEventArgs(residentProgress, 
     252                            new TaskProgressChangedEventArgs(string.Empty, 0, 0)));*/ 
    251253 
    252254                        if (Task.Canceled) 
     
    263265                Progress.Steps.Add(new SteppedProgressManagerStep(tempFiles, 
    264266                    0.0f, S._("Removing temporary files..."))); 
    265                 OnProgressChanged(this, new ProgressChangedEventArgs(tempFiles, 
    266                     new TaskProgressChangedEventArgs(string.Empty, 0, 0))); 
     267                /*OnProgressChanged(this, new ProgressChangedEventArgs(tempFiles, 
     268                    new TaskProgressChangedEventArgs(string.Empty, 0, 0)));*/ 
    267269                info.Delete(true); 
    268270                tempFiles.MarkComplete(); 
     
    287289 
    288290                    //Set the event parameters, then broadcast the progress event. 
    289                     OnProgressChanged(this, new ProgressChangedEventArgs(structureProgress, 
    290                         new TaskProgressChangedEventArgs(string.Empty, 0, 0))); 
     291                    /*OnProgressChanged(this, new ProgressChangedEventArgs(structureProgress, 
     292                        new TaskProgressChangedEventArgs(string.Empty, 0, 0)));*/ 
    291293                } 
    292294            ); 
     
    342344                        { 
    343345                            mainProgress.Completed += lastWritten; 
    344                             OnProgressChanged(this, new ProgressChangedEventArgs(mainProgress, 
    345                                 new TaskProgressChangedEventArgs(Drive, currentPass, method.Passes))); 
     346                            /*OnProgressChanged(this, new ProgressChangedEventArgs(mainProgress, 
     347                                new TaskProgressChangedEventArgs(Drive, currentPass, method.Passes)));*/ 
    346348 
    347349                            if (Task.Canceled) 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/IErasureTarget.cs

    r2467 r2468  
    9393        /// </summary> 
    9494        void Execute(); 
     95 
     96        /// <summary> 
     97        /// Gets the progress manager for this Erasure Target. 
     98        /// </summary> 
     99        ProgressManagerBase Progress 
     100        { 
     101            get; 
     102        } 
    95103    } 
    96104 
Note: See TracChangeset for help on using the changeset viewer.