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

Rename FilecopyFinished to TransferInProgress and invert boolean.

parent ef210f24
No related branches found
No related tags found
No related merge requests found
......@@ -256,7 +256,7 @@ namespace AutoTx
writeLogDebug("------ Loaded status flags ------");
writeLogDebug("CurrentTransferSrc: " + _status.CurrentTransferSrc);
writeLogDebug("CurrentTargetTmp: " + _status.CurrentTargetTmp);
writeLogDebug("FilecopyFinished: " + _status.FilecopyFinished);
writeLogDebug("TransferInProgress: " + _status.TransferInProgress);
writeLogDebug("LastStorageNotification: " +
_status.LastStorageNotification.ToString("yyyy-MM-dd HH:mm:ss"));
writeLogDebug("LastAdminNotification: " +
......@@ -358,7 +358,7 @@ namespace AutoTx
catch (Exception ex) {
writeLog("Error terminating the RoboCopy process: " + ex.Message, true);
}
_status.FilecopyFinished = false;
_status.TransferInProgress = true;
writeLog("Not all files were transferred - will resume upon next start");
writeLogDebug("CurrentTransferSrc: " + _status.CurrentTransferSrc);
// should we delete an incompletely transferred file on the target?
......@@ -654,7 +654,7 @@ namespace AutoTx
// only happens while all system parameters are within their valid ranges
// make sure the service is in an expected state before cleaning up:
if (_transferState != TxState.Stopped || _status.FilecopyFinished != true)
if (_transferState != TxState.Stopped || _status.TransferInProgress)
return;
if (_status.CurrentTargetTmp.Length > 0) {
......@@ -684,10 +684,10 @@ namespace AutoTx
// CONDITIONS (a transfer has to be resumed):
// - CurrentTargetTmp has to be non-empty
// - TransferState has to be "Stopped"
// - FileCopyFinished must be false
// - TransferInProgress must be true
if (_status.CurrentTargetTmp.Length <= 0 ||
_transferState != TxState.Stopped ||
_status.FilecopyFinished)
_status.TransferInProgress == false)
return;
writeLogDebug("Resuming transfer from '" + _status.CurrentTransferSrc +
......
......@@ -27,7 +27,7 @@ namespace AutoTx
CreateNewDirectory(ExpandCurrentTargetTmp(), false);
_transferState = TxState.Active;
_status.FilecopyFinished = false;
_status.TransferInProgress = true;
try {
// events
_roboCommand.OnCopyProgressChanged += RsProgressChanged;
......@@ -136,7 +136,7 @@ namespace AutoTx
_transferState = TxState.Stopped;
_roboCommand.Dispose();
_roboCommand = new RoboCommand();
_status.FilecopyFinished = true;
_status.TransferInProgress = false;
}
/// <summary>
......
......@@ -17,7 +17,7 @@ namespace AutoTx.XmlWrapper
string _currentTransferSrc;
string _currentTargetTmp;
bool _filecopyFinished;
bool _transferInProgress;
private bool _serviceSuspended;
private bool _cleanShutdown;
......@@ -83,10 +83,10 @@ namespace AutoTx.XmlWrapper
}
}
public bool FilecopyFinished {
get { return _filecopyFinished; }
public bool TransferInProgress {
get { return _transferInProgress; }
set {
_filecopyFinished = value;
_transferInProgress = value;
log("FilecopyFinished was updated (" + value + "), calling Serialize()...");
Serialize();
}
......@@ -115,7 +115,7 @@ namespace AutoTx.XmlWrapper
public ServiceStatus() {
_currentTransferSrc = "";
_currentTargetTmp = "";
_filecopyFinished = true;
_transferInProgress = false;
}
public void Serialize() {
......
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