Changeset 2168 for branches/eraser6/6.0/Eraser.Util/VolumeInfo.cs
- Timestamp:
- 6/13/2010 6:21:46 AM (3 years ago)
- File:
-
- 1 edited
-
branches/eraser6/6.0/Eraser.Util/VolumeInfo.cs (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/6.0/Eraser.Util/VolumeInfo.cs
r2146 r2168 91 91 private List<string> GetLocalVolumeMountPoints() 92 92 { 93 if (!IsReady) 94 throw new InvalidOperationException("The volume has not been mounted or is not " + 95 "currently ready."); 96 93 97 List<string> result = new List<string>(); 94 98 … … 365 369 get 366 370 { 371 if (!IsReady) 372 throw new InvalidOperationException("The volume has not been mounted or is not " + 373 "currently ready."); 367 374 return (DriveType)KernelApi.NativeMethods.GetDriveType(VolumeId); 368 375 } … … 376 383 get 377 384 { 385 if (!IsReady) 386 throw new InvalidOperationException("The volume has not been mounted or is not " + 387 "currently ready."); 388 378 389 uint clusterSize, sectorSize, freeClusters, totalClusters; 379 390 if (KernelApi.NativeMethods.GetDiskFreeSpace(VolumeId, out clusterSize, … … 394 405 get 395 406 { 407 if (!IsReady) 408 throw new InvalidOperationException("The volume has not been mounted or is not " + 409 "currently ready."); 410 396 411 uint clusterSize, sectorSize, freeClusters, totalClusters; 397 412 if (KernelApi.NativeMethods.GetDiskFreeSpace(VolumeId, out clusterSize, … … 412 427 get 413 428 { 429 if (!IsReady) 430 throw new InvalidOperationException("The volume has not been mounted or is not " + 431 "currently ready."); 432 414 433 ulong freeBytesAvailable, totalNumberOfBytes, totalNumberOfFreeBytes; 415 434 if (KernelApi.NativeMethods.GetDiskFreeSpaceEx(VolumeId, out freeBytesAvailable, … … 440 459 get 441 460 { 461 if (!IsReady) 462 throw new InvalidOperationException("The volume has not been mounted or is not " + 463 "currently ready."); 464 442 465 ulong result, dummy; 443 466 if (KernelApi.NativeMethods.GetDiskFreeSpaceEx(VolumeId, out dummy, … … 458 481 get 459 482 { 483 if (!IsReady) 484 throw new InvalidOperationException("The volume has not been mounted or is not " + 485 "currently ready."); 486 460 487 ulong result, dummy; 461 488 if (KernelApi.NativeMethods.GetDiskFreeSpaceEx(VolumeId, out dummy, … … 476 503 get 477 504 { 505 if (!IsReady) 506 throw new InvalidOperationException("The volume has not been mounted or is not " + 507 "currently ready."); 508 478 509 ulong result, dummy; 479 510 if (KernelApi.NativeMethods.GetDiskFreeSpaceEx(VolumeId, out result, … … 495 526 get 496 527 { 528 if (!IsReady) 529 throw new InvalidOperationException("The volume has not been mounted or is not " + 530 "currently ready."); 531 497 532 List<VolumeInfo> result = new List<VolumeInfo>(); 498 533 StringBuilder nextMountpoint = new StringBuilder( … … 528 563 get 529 564 { 565 if (!IsReady) 566 throw new InvalidOperationException("The volume has not been mounted or is not " + 567 "currently ready."); 568 530 569 return (VolumeType == DriveType.Network ? 531 570 GetNetworkMountPoints() : GetLocalVolumeMountPoints()).AsReadOnly(); … … 538 577 public bool IsMounted 539 578 { 540 get { return MountPoints.Count != 0; }579 get { return IsReady && MountPoints.Count != 0; } 541 580 } 542 581
Note: See TracChangeset
for help on using the changeset viewer.
