internal static bool CloseTarget(bool updateDomains = true) { if (UnityWatch.currentFileInfo.targetInterface != null) { UnityWatch.KillProcess(); if (!UnityWatch.RestoreTarget()) { MessageBox.Show("Unable to restore the backup. Aborting!"); return(false); } UnityWatch.currentFileInfo.targetInterface.CloseStream(); UnityWatch.currentFileInfo.targetInterface = null; } if (updateDomains) { UpdateDomains(); } return(true); }
private void BtnRestoreBackup_Click(object sender, EventArgs e) { UnityWatch.KillProcess(); UnityWatch.currentFileInfo.targetInterface?.CloseStream(); UnityWatch.currentFileInfo.targetInterface?.RestoreBackup(); }