From 0139315c517bfead6a0cbbdb1862d1138f7eac41 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Thu, 25 Apr 2019 14:53:00 +0200
Subject: [PATCH] Add convenience method to check if free space is below its
 threshold

Refers to #20
---
 ATxCommon/Serializables/DriveToCheck.cs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ATxCommon/Serializables/DriveToCheck.cs b/ATxCommon/Serializables/DriveToCheck.cs
index a836ec3..600ba9c 100644
--- a/ATxCommon/Serializables/DriveToCheck.cs
+++ b/ATxCommon/Serializables/DriveToCheck.cs
@@ -22,5 +22,13 @@ namespace ATxCommon.Serializables
         /// </summary>
         [XmlIgnore]
         public long FreeSpace { get; set; } = -1;
+
+        /// <summary>
+        /// Convenience method to check if this drive's free space is below its threshold.
+        /// </summary>
+        /// <returns>True if free space is below the threshold, false otherwise.</returns>
+        public bool DiskSpaceLow() {
+            return FreeSpace < SpaceThreshold * Conv.GigaBytes;
+        }
     }
 }
\ No newline at end of file
-- 
GitLab