private bool WaitForBackupCompletion() { Assert.IsNotNull(_application); for (int i = 0; i < 40; i++) { try { string logFile = _application.Settings.Backup.LogFile; string contents = Utilities.ReadExistingTextFile(logFile); if (contents.IndexOf("Backup completed successfully") > 0) { return(true); } if (contents.IndexOf("BACKUP ERROR:") > 0) { return(false); } } catch (Exception) { // probably a share access violation. } Thread.Sleep(250); } return(false); }