Skip to content
Snippets Groups Projects
Commit 89bba097 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Move byte size constants to ATXCommon.Conv.

parent 5b022d47
No related branches found
No related tags found
No related merge requests found
......@@ -35,9 +35,6 @@ namespace AutoTx
private int _txProgress;
private const int MegaBytes = 1024 * 1024;
private const int GigaBytes = 1024 * 1024 * 1024;
private DateTime _lastUserDirCheck = DateTime.Now;
// the transfer state:
......
......@@ -73,7 +73,7 @@ namespace AutoTx
_roboCommand.RetryOptions.RetryWaitTime = 2;
_roboCommand.Start();
Log.Info("Transfer started, total size: {0} MB",
_status.CurrentTransferSize / MegaBytes);
_status.CurrentTransferSize / Conv.MegaBytes);
}
catch (ManagementException ex) {
Log.Error("Error in StartTransfer(): {0}", ex.Message);
......
......@@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Management;
using ATXCommon;
namespace AutoTx
{
......@@ -55,7 +56,7 @@ namespace AutoTx
private long GetFreeDriveSpace(string drive) {
try {
var dInfo = new DriveInfo(drive);
return dInfo.TotalFreeSpace / MegaBytes;
return dInfo.TotalFreeSpace / Conv.MegaBytes;
}
catch (Exception ex) {
Log.Warn("Error in GetFreeDriveSpace({0}): {1}", drive, ex.Message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment