예제 #1
0
        private void CreateBackup()
        {
            string backupPath = this.MyAppFolder.FullName + "_Backup";

            if (!Directory.Exists(backupPath))
            {
                DirectoryCopy.Copy(this.MyAppFolder.FullName, backupPath);
            }
        }
예제 #2
0
        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);
        }