/// <summary> /// Attempts to copy back any changes from the temporary file, and clean up /// </summary> /// <param name="sender">Unused</param> /// <param name="e">Unused</param> public void CleanUp(object sender, EventArgs e) { this.Watcher.Dispose(); this.Watcher = null; while (this.IsLocked()) { System.Threading.Thread.Sleep(100); } this.UpdateOriginal(); EncryptedFile.Delete(this.TempFilePath, new Random()); }