Changeset 436


Ignore:
Timestamp:
10/02/08 02:42:07 (6 years ago)
Author:
lowjoel
Message:

Renamed the "Drive" class to the "VolumeInfo?" class since the latter is a more accurate description of what the class does.

Location:
branches/eraser6
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Eraser/TaskDataSelectionForm.cs

    r402 r436  
    5555 
    5656            //Populate the drives list 
    57             List<Volume> volumes = Volume.GetVolumes(); 
    58             foreach (Volume volume in volumes) 
     57            List<VolumeInfo> volumes = VolumeInfo.GetVolumes(); 
     58            foreach (VolumeInfo volume in volumes) 
    5959            { 
    6060                DriveType driveType = volume.VolumeType; 
  • branches/eraser6/Manager/DirectExecutor.cs

    r423 r436  
    398398 
    399399            //If the user is under disk quotas, log a warning message 
    400             if (Volume.FromMountpoint(target.Drive).HasQuota) 
     400            if (VolumeInfo.FromMountpoint(target.Drive).HasQuota) 
    401401                task.Log.Add(new LogEntry("The drive which is having its unused space erased has " + 
    402402                    "disk quotas active. This will prevent the complete erasure of unused space and " + 
     
    449449                //Determine the total amount of data that needs to be written. 
    450450                WriteStatistics statistics = new WriteStatistics(); 
    451                 Volume volInfo = Volume.FromMountpoint(target.Drive); 
     451                VolumeInfo volInfo = VolumeInfo.FromMountpoint(target.Drive); 
    452452                long totalSize = method.CalculateEraseDataSize(null, volInfo.TotalFreeSpace); 
    453453 
     
    647647        private void EraseFilesystemRecords(DirectoryInfo info, ErasureMethod method) 
    648648        { 
    649             Volume volInfo = Volume.FromMountpoint(info.FullName); 
     649            VolumeInfo volInfo = VolumeInfo.FromMountpoint(info.FullName); 
    650650            string volFormat = volInfo.VolumeFormat; 
    651651            if (volFormat == "NTFS") 
     
    816816        { 
    817817            StreamInfo info = new StreamInfo(filePath); 
    818             Volume volume = Volume.FromMountpoint(info.Directory.FullName); 
     818            VolumeInfo volume = VolumeInfo.FromMountpoint(info.Directory.FullName); 
    819819            long clusterSize = volume.ClusterSize; 
    820820            return (info.Length + (clusterSize - 1)) & ~(clusterSize - 1); 
  • branches/eraser6/Util/Util.csproj

    r365 r436  
    4343    <Compile Include="KernelAPI.cs" /> 
    4444    <Compile Include="File.cs" /> 
    45     <Compile Include="Drive.cs" /> 
     45    <Compile Include="VolumeInfo.cs" /> 
    4646    <Compile Include="NetAPI.cs" /> 
    4747    <Compile Include="NTAPI.cs" /> 
  • branches/eraser6/Util/VolumeInfo.cs

    r427 r436  
    3131namespace Eraser.Util 
    3232{ 
    33     public class Volume 
     33    public class VolumeInfo 
    3434    { 
    3535        /// <summary> 
     
    3737        /// </summary> 
    3838        /// <param name="volumeID">The ID of the volume, in the form "\\?\Volume{GUID}\"</param> 
    39         public Volume(string volumeID) 
     39        public VolumeInfo(string volumeID) 
    4040        { 
    4141            //Set the volume Id 
     
    109109        /// <returns>Returns a list of volumes representing all volumes present in 
    110110        /// the system.</returns> 
    111         public static List<Volume> GetVolumes() 
    112         { 
    113             List<Volume> result = new List<Volume>(); 
     111        public static List<VolumeInfo> GetVolumes() 
     112        { 
     113            List<VolumeInfo> result = new List<VolumeInfo>(); 
    114114            StringBuilder nextVolume = new StringBuilder(LongPath * sizeof(char)); 
    115115            SafeHandle handle = FindFirstVolume(nextVolume, LongPath); 
     
    119119            //Iterate over the volume mountpoints 
    120120            do 
    121                 result.Add(new Volume(nextVolume.ToString())); 
     121                result.Add(new VolumeInfo(nextVolume.ToString())); 
    122122            while (FindNextVolume(handle, nextVolume, LongPath)); 
    123123 
     
    135135        /// <returns>The volume object if such a volume exists, or an exception 
    136136        /// is thrown.</returns> 
    137         public static Volume FromMountpoint(string mountpoint) 
     137        public static VolumeInfo FromMountpoint(string mountpoint) 
    138138        { 
    139139            DirectoryInfo mountpointDir = new DirectoryInfo(mountpoint); 
     
    146146                    currentDir += '\\'; 
    147147                if (GetVolumeNameForVolumeMountPoint(currentDir, volumeID, 50)) 
    148                     return new Volume(volumeID.ToString()); 
     148                    return new VolumeInfo(volumeID.ToString()); 
    149149                else if (Marshal.GetLastWin32Error() != 4390 /*ERROR_NOT_A_REPARSE_POINT*/) 
    150150                    throw new Win32Exception(Marshal.GetLastWin32Error()); 
     
    293293        /// contains volume mountpoints. 
    294294        /// </summary> 
    295         public List<Volume> MountedVolumes 
    296         { 
    297             get 
    298             { 
    299                 List<Volume> result = new List<Volume>(); 
     295        public List<VolumeInfo> MountedVolumes 
     296        { 
     297            get 
     298            { 
     299                List<VolumeInfo> result = new List<VolumeInfo>(); 
    300300                StringBuilder nextMountpoint = new StringBuilder(LongPath * sizeof(char)); 
    301301 
     
    307307                //Iterate over the volume mountpoints 
    308308                while (FindNextVolumeMountPoint(handle, nextMountpoint, LongPath)) 
    309                     result.Add(new Volume(nextMountpoint.ToString())); 
     309                    result.Add(new VolumeInfo(nextMountpoint.ToString())); 
    310310 
    311311                //Close the handle 
Note: See TracChangeset for help on using the changeset viewer.