AA2Install.formMain.IsEnoughFreeSpace C# (CSharp) Method

IsEnoughFreeSpace() public method

Returns true or false if the drive indicated has enough space for the operation.
public IsEnoughFreeSpace ( string drivePath, long requiredBytes ) : bool
drivePath string The path to the drive (eg. "C:\")
requiredBytes long The amount of bytes required for the operation.
return bool
        public bool IsEnoughFreeSpace(string drivePath, long requiredBytes)
        {
            var drive = DriveInfo.GetDrives().First(x => x.Name.First() == drivePath.First());

            return drive.AvailableFreeSpace > requiredBytes;
        }