private void CreateBackup() { string backupPath = this.MyAppFolder.FullName + "_Backup"; if (!Directory.Exists(backupPath)) { DirectoryCopy.Copy(this.MyAppFolder.FullName, backupPath); } }
private void Cleanup() { string backupPath = this.MyAppFolder.FullName + "_Backup"; if (!Directory.Exists(backupPath)) { throw new DirectoryNotFoundException("Backup folder missing: " + backupPath); } Directory.Delete(this.MyAppFolder.FullName, true); DirectoryCopy.Copy(backupPath, this.MyAppFolder.FullName); }