Changeset 2228


Ignore:
Timestamp:
08/04/10 01:14:58 (4 years ago)
Author:
lowjoel
Message:

Based on r2226, allow the file and folder erasure target configurers to detect a path (of their own type) and then accept it as their own. This allows the specification of paths on the command line without explicit handler requirements, so things like these work:

eraser addtask D:\test.txt D:\testing

And a file target and a directory target will be made, respectively, using default settings.

Also fixed an implementation error where the return code of the ProcessArgument? function was not properly set.

Location:
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FileErasureTargetConfigurer.cs

    r2070 r2228  
    3333using Eraser.Manager; 
    3434using Eraser.Util; 
     35using System.IO; 
    3536 
    3637namespace Eraser.DefaultPlugins 
     
    9394                return true; 
    9495            } 
     96            else if (File.Exists(argument)) 
     97            { 
     98                filePath.Text = argument; 
     99                return true; 
     100            } 
    95101 
    96102            return false; 
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTargetConfigurer.cs

    r2070 r2228  
    3333using Eraser.Manager; 
    3434using Eraser.Util; 
     35using System.IO; 
    3536 
    3637namespace Eraser.DefaultPlugins 
     
    111112                if (match.Groups["directoryIncludeMask"].Success) 
    112113                    folderInclude.Text += match.Groups["directoryIncludeMask"].Value.Remove(0, 2) + ' '; 
     114 
     115                return true; 
     116            } 
     117            else if (Directory.Exists(argument)) 
     118            { 
     119                folderPath.Text = argument; 
     120                folderDelete.Checked = false; 
     121                folderInclude.Text = folderExclude.Text = string.Empty; 
     122                return true; 
    113123            } 
    114124 
Note: See TracChangeset for help on using the changeset viewer.