Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Added XML Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Aug 3, 2022
1 parent 46a1a92 commit efd4a37
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
33 changes: 33 additions & 0 deletions LeoCorpLibrary.Core/Env.cs
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,39 @@ public static bool IsDirectoryHasPermission(string filePath)
/// <returns>A <see cref="DriveInfo"/> value, which contains the information of the drive.</returns>
public static DriveInfo GetDriveWithLowestFreeSpace() => DriveInfo.GetDrives().OrderBy(d => d.TotalFreeSpace).First();

/// <summary>
/// Gets the appropriate <see cref="UnitType"/> to use depending of the total sizer of the drive.
/// </summary>
/// <param name="driveInfo">The drive to get the unit of.</param>
/// <returns>A <see cref="UnitType"/> value, the appropriate unit.</returns>
public static UnitType GetDriveUnitType(DriveInfo driveInfo)
{
if (driveInfo.TotalSize >= Math.Pow(1024, 5))
{
return UnitType.Petabyte;
}
if (driveInfo.TotalSize >= Math.Pow(1024, 4))
{
return UnitType.Terabyte;
}
if (driveInfo.TotalSize >= 1073741824)
{
return UnitType.Gigabyte;
}
else if (driveInfo.TotalSize >= 1048576)
{
return UnitType.Megabyte;
}
else if (driveInfo.TotalSize >= 1024)
{
return UnitType.Kilobyte;
}
else
{
return UnitType.Byte;
}
}

/// <summary>
/// Returns <see langword="true"/> if the operating system support dark theme.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions LeoCorpLibrary/Env.cs
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@ public static void LaunchUWPApp(string packageFamilyName, string applicationID)
/// <returns>A <see cref="DriveInfo"/> value, which contains the information of the drive.</returns>
public static DriveInfo GetDriveWithLowestFreeSpace() => DriveInfo.GetDrives().OrderBy(d => d.TotalFreeSpace).First();

/// <summary>
/// Gets the appropriate <see cref="UnitType"/> to use depending of the total sizer of the drive.
/// </summary>
/// <param name="driveInfo">The drive to get the unit of.</param>
/// <returns>A <see cref="UnitType"/> value, the appropriate unit.</returns>
public static UnitType GetDriveUnitType(DriveInfo driveInfo)
{
if (driveInfo.TotalSize >= Math.Pow(1024, 5))
Expand Down

0 comments on commit efd4a37

Please sign in to comment.