diff --git a/AutoTx/AutoTx.cs b/AutoTx/AutoTx.cs index 1ce230324ed04c9145c3a26b719d16f413ef78ea..2a792348bf95a84d2735a12edbcacda9bc0f995f 100644 --- a/AutoTx/AutoTx.cs +++ b/AutoTx/AutoTx.cs @@ -418,7 +418,7 @@ namespace AutoTx // all parameters within valid ranges, so set the state to "Running": if (string.IsNullOrEmpty(limitReason)) { - _serviceSuspended = false; + _status.ServiceSuspended = false; if (!string.IsNullOrEmpty(_status.LimitReason)) { _status.LimitReason = ""; // reset to force a message on next service suspend writeLog("Service resuming operation (all parameters in valid ranges)."); @@ -428,7 +428,7 @@ namespace AutoTx // set state to "Running" if no-one is logged on: if (NoUserIsLoggedOn()) { - _serviceSuspended = false; + _status.ServiceSuspended = false; if (!string.IsNullOrEmpty(_status.LimitReason)) { _status.LimitReason = ""; // reset to force a message on next service suspend writeLog("Service resuming operation (no user logged on)."); @@ -437,7 +437,7 @@ namespace AutoTx } // by reaching this point we know the service should be suspended: - _serviceSuspended = true; + _status.ServiceSuspended = true; if (limitReason == _status.LimitReason) return; writeLog("Service suspended due to limitiations [" + limitReason + "]."); @@ -458,7 +458,7 @@ namespace AutoTx CreateIncomingDirectories(); // tasks depending on the service state: - if (_serviceSuspended) { + if (_status.ServiceSuspended) { // make sure to pause any running transfer: PauseTransfer(); } else { diff --git a/AutoTx/SystemChecks.cs b/AutoTx/SystemChecks.cs index 0dca881d14f06c3bf1c7342a9f01e6856db1df18..6898c00e2b9f1b13bb67eb54ded9dbf0e83bca7d 100644 --- a/AutoTx/SystemChecks.cs +++ b/AutoTx/SystemChecks.cs @@ -7,11 +7,6 @@ namespace AutoTx { public partial class AutoTx { - #region global variables - - private bool _serviceSuspended; // TODO: this should be part of _status! - - #endregion /// <summary> /// Get the available physical memory in MB. diff --git a/AutoTx/XmlConfiguration.cs b/AutoTx/XmlConfiguration.cs index dbaf2005d4bbd319f3e301e6ac252d07578271a0..7fce8b0146cde799fce96d0240ab1a17bdab1676 100644 --- a/AutoTx/XmlConfiguration.cs +++ b/AutoTx/XmlConfiguration.cs @@ -127,6 +127,7 @@ namespace AutoTx string _currentTargetTmp; bool _filecopyFinished; + private bool _serviceSuspended; private bool _cleanShutdown; private long _currentTransferSize; @@ -182,6 +183,15 @@ namespace AutoTx } } + public bool ServiceSuspended { + get { return _serviceSuspended; } + set { + _serviceSuspended = value; + log("ServiceSuspended was updated (" + value + "), calling Serialize()..."); + Serialize(); + } + } + public bool FilecopyFinished { get { return _filecopyFinished; } set {