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

Make ServiceSuspended part of the status class.

parent 7e671c4d
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
......@@ -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.
......
......@@ -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 {
......
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