Changeset 2170
- Timestamp:
- 6/13/2010 6:28:11 AM (3 years ago)
- Location:
- trunk/eraser
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs (modified) (1 diff)
-
Eraser.Util/VolumeInfo.cs (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser
- Property svn:mergeinfo changed
/branches/eraser6/6.0 merged: 2168
- Property svn:mergeinfo changed
-
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs
r2167 r2170 188 188 bool isVolumeRoot = directory.Parent == null; 189 189 foreach (VolumeInfo volume in VolumeInfo.Volumes) 190 foreach (DirectoryInfo mountPoint in volume.MountPoints) 191 if (directory.FullName == mountPoint.FullName) 192 isVolumeRoot = true; 190 if (volume.IsReady) 191 foreach (DirectoryInfo mountPoint in volume.MountPoints) 192 if (directory.FullName == mountPoint.FullName) 193 isVolumeRoot = true; 193 194 194 195 //If the folder is a mount point, then don't delete it. If it isn't, -
trunk/eraser/Eraser.Util/VolumeInfo.cs
r2149 r2170 92 92 private List<string> GetLocalVolumeMountPoints() 93 93 { 94 if (!IsReady) 95 throw new InvalidOperationException("The volume has not been mounted or is not " + 96 "currently ready."); 97 94 98 List<string> result = new List<string>(); 95 99 … … 406 410 get 407 411 { 412 if (!IsReady) 413 throw new InvalidOperationException("The volume has not been mounted or is not " + 414 "currently ready."); 408 415 return (DriveType)NativeMethods.GetDriveType(VolumeId); 409 416 } … … 417 424 get 418 425 { 426 if (!IsReady) 427 throw new InvalidOperationException("The volume has not been mounted or is not " + 428 "currently ready."); 429 419 430 uint clusterSize, sectorSize, freeClusters, totalClusters; 420 431 if (NativeMethods.GetDiskFreeSpace(VolumeId, out clusterSize, … … 435 446 get 436 447 { 448 if (!IsReady) 449 throw new InvalidOperationException("The volume has not been mounted or is not " + 450 "currently ready."); 451 437 452 uint clusterSize, sectorSize, freeClusters, totalClusters; 438 453 if (NativeMethods.GetDiskFreeSpace(VolumeId, out clusterSize, … … 453 468 get 454 469 { 470 if (!IsReady) 471 throw new InvalidOperationException("The volume has not been mounted or is not " + 472 "currently ready."); 473 455 474 ulong freeBytesAvailable, totalNumberOfBytes, totalNumberOfFreeBytes; 456 475 if (NativeMethods.GetDiskFreeSpaceEx(VolumeId, out freeBytesAvailable, … … 481 500 get 482 501 { 502 if (!IsReady) 503 throw new InvalidOperationException("The volume has not been mounted or is not " + 504 "currently ready."); 505 483 506 ulong result, dummy; 484 507 if (NativeMethods.GetDiskFreeSpaceEx(VolumeId, out dummy, out dummy, out result)) … … 498 521 get 499 522 { 523 if (!IsReady) 524 throw new InvalidOperationException("The volume has not been mounted or is not " + 525 "currently ready."); 526 500 527 ulong result, dummy; 501 528 if (NativeMethods.GetDiskFreeSpaceEx(VolumeId, out dummy, out result, out dummy)) … … 515 542 get 516 543 { 544 if (!IsReady) 545 throw new InvalidOperationException("The volume has not been mounted or is not " + 546 "currently ready."); 547 517 548 ulong result, dummy; 518 549 if (NativeMethods.GetDiskFreeSpaceEx(VolumeId, out result, out dummy, out dummy)) … … 533 564 get 534 565 { 566 if (!IsReady) 567 throw new InvalidOperationException("The volume has not been mounted or is not " + 568 "currently ready."); 569 535 570 List<VolumeInfo> result = new List<VolumeInfo>(); 536 571 StringBuilder nextMountpoint = new StringBuilder(NativeMethods.LongPath * sizeof(char)); … … 569 604 get 570 605 { 606 if (!IsReady) 607 throw new InvalidOperationException("The volume has not been mounted or is not " + 608 "currently ready."); 609 571 610 List<string> paths = VolumeType == DriveType.Network ? 572 611 GetNetworkMountPoints() : GetLocalVolumeMountPoints(); … … 581 620 public bool IsMounted 582 621 { 583 get { return MountPoints.Count != 0; }622 get { return IsReady && MountPoints.Count != 0; } 584 623 } 585 624
Note: See TracChangeset
for help on using the changeset viewer.
